I’m working in a few stress test in Jmeter, but using Selenium (With javascript), but I have problem pressing the next button in the script:
Press the image to see the code of the buttom
I have already used by.xpath, by.id, by.linkText but none of these work.
var idsin = WDS.browser.findElement(pkg.By.linkText('Consultar'))
idsin.click()
Is there another way to press this button?
2
Answers
Thanks, i'm aware of all of that. But I have to do it for a situation with the login and menu. But after that button, and can use and http Request. However, the response to the xpath you give me is:
You’re using 3 mutually exclusive terms in one sentence: "stress test", "Selenium" and "javascript"
Be aware that using real browsers for stress testing is not recommended by:
Selenium developers:
WebDriver Sampler developers:
If you think you’re smarter than they the only piece of advice I can provide is using XPath locator and partial text, something like:
because there are starting and trailing whitespaces all around the element is not a "link", it’s a button
Also be careful with this JavaScript, it has been removed from JDK 15 and you will either need to put an extra effort or downgrade to older JVM in nearest future.
However the best option would be switching to JMeter’s HTTP Request samplers, given you properly configure JMeter to behave like a real browser there will be no difference from network footprint perspective and you will save a lot of time, money and trees.