JMeter and JavaScript

JMeter is not a browser, and does not interpret the JavaScript in downloaded pages.

From the JMeter wiki:

JMeter does not process Javascript or applets embedded in HTML pages.

JMeter can download the relevant resources (some embedded resources
are downloaded automatically if the correct options are set), but it
does not process the HTML and execute any Javascript functions.

If the page uses Javascript to build up a URL or submit a form, you
can use the Proxy Recording facility to create the necessary sampler.
If this is not possible, then manual inspection of the code may be
needed to determine what the Javascript is doing.

Depending on what you are doing, you could create an execution test using Selenium IDE for Firefox. The test will run in your browser so the JavaScript will also run. Note though that I never used Selenium as a substitute for JMeter and don’t know about common features to both the tools.

Leave a Comment