views:

27

answers:

2

When I make HTTP Request in JMeter I get Response data like "This page uses JavaScript and requires a JavaScript enabled browser." How is it possible to fix this problem.

A: 

There is the possibility that your web browser has JavaScript disabled, enable it and try again. What Web Browser are you using? In Firefox it would be something like Tools -> Options -> Content -> Enable JavaScript

StudiousJoseph
+2  A: 

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.

dpb
I used Proxy Recording and I can see the variable that I entered but in Response I get that message, also this message is the same as when I run in Firefox with disable JavaScript. Is it possible to test like this application with JMeter.
Gogoo
It really depends on what you are testing for. JMeter was initially created to test server functionality (under heavy load, for performance, response time etc). If JavaScript is just used for GUI effects that don't interact with the functionality of the app (i.e. to make it looks fancy) then you can use JMeter to test that functionality, bypassing the message you get (it should be a filter of some sort in your app that tests for JS enabled that you can turn off). If on the other hand JavaScript is a must, then you need browser capabilities and JMeter does not (at least yet) provide those.
dpb