1
votes

After executing Login feature, Response data in "View Results in Tree" shows following:

JavaScript seems to be disabled in your browser. You must have JavaScript enabled in your browser to utilize the functionality of this website.

Note: JavaScript in Firefox is enabled and I have used "Test Script Recorder" to record browser session.

I went through below posts but nothing helped so far: JMeter and JavaScript

1
In the HTTP Sampler that's making the request, try checking the "Retrieve all embedded resources from HTML files". This will ensure that images, JS files, CSS files, etc. are retrieved from the server.Adnan

1 Answers

2
votes

From JMeter project main page

JMeter is not a browser. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever viewed at a time).

Although JMeter cannot execute JavaScript, it is capable of recording associated HTTP Requests.

In case of simulating a login with JMeter it might be the case when some dynamic token is being generated with JavaScript so you need to extract it from the 1st response source code and add as a parameter to 2nd request so your test should look like:

  1. GET request to login page
  2. POST request to login page (pass dynamic parameter(s) extracted in previous step along with the credentials)

See How To Use JMeter For Login Authentication for detailed step-by-step instructions.