Question

I'm trying to create sress test with JMeter and herefor is absolute required to produce mouse onClick-event for some elements. But I cannot find any possibility to produce onClick-event with JMeter.

Was it helpful?

Solution

jMeter doesn't evaluate the HTML or JavaScript that is returned by the webserver, it just captures it.

So, no, you can't do an onClick event with jMeter. What you can do however is extract the url that the onClick event would trigger using the Regular Expression Extractor, and then feed that url to a new HTTP Sampler.

OTHER TIPS

Jmeter is designed to simulate the server traffic (e.g. HTTP) generated by client (e.g. web browser). It does not simulate the entire browser. So no, you cannot produce or simulate the onClick() event, but you probably can simulate the traffic generated by that event.

To do this, you'll need a tool to capture the requests sent to the server when this onClick() event happens. Then you can model those requests in your JMeter script, just like you've modeled other requests.

JMeter is intended to run load (or general connectivity) tests against a back end service like, for example, a web application running on an application server like Tomcat, Weblogic, WebSphere, etc..

If you would like to 'drive' a browser in a test environment, take a look at tools like Selenium

Since you mentioned JMeter, I'm assuming you may want to stick to Java (or the JVM, at least) so you could look at Geb as an alternative to Selenium.

There are many other similar tools, though. Have a look at: http://alternativeto.net/software/selenium

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top