rakeshghl44
rakeshghl44

Reputation: 21

Imported Javascript not working in jmeter from Badboy

I am getting some below errors. As I have been executing imported script into Jmeter from Badboy tool. Does anyone knw , wht steps I have been missed?

Is thr any way to executing javascript into jmeter from badboy?

Please refer diff screenshots.

Response code: 400 Response code: 405 Response code: 500

1 1 2

Upvotes: -2

Views: 487

Answers (1)

Dmitri T
Dmitri T

Reputation: 168247

Be aware that the chance you will be able to successfully replay recorded script is close to zero. Modern web applications widely use dynamic parameters for CSRF protection, client-side state management, client tracking, whatever. The majority of load testing tools record requests "as is" so all these parameters which need to be dynamic are basically hard-coded. So my expectation is that you need to revisit your recorded test and add some correlation to it, the process looks as follows:

  1. Record your test scenario one more time and compare generated scripts. All request parameters which are different needs to be correlated.
  2. Correlation looks as follows:

    • Execute first request
      • Extract dynamic parameters using suitable JMeter PostProcessor
      • Substitute recorded hard-coded values with JMeter Variables coming from the PostProcessor(s)
    • Execute second request
    • Repeat above steps unless your test will be doing what is supposed to be doing, you can verify request and response details using View Results Tree listener. Also be aware that "green triangle" doesn't necessarily mean "success", you might be hitting login page all the time.
  3. And last but not the least - don't forget to add HTTP Cookie Manager to your Test Plan.

As an alternative to BadBoy tool you can consider recording your test using cloud-based proxy service, it can export recorded scripts in "SmartJMX" mode with automatic detection and correlation of all dynamic parameters, see How to Cut Your JMeter Scripting Time by 80% guide for more details.

LoadRunner tool also has this automatic correlation feature so you can install Community Edition which is free up to 50 virtual users and see what generated script looks like.

Upvotes: 0

Related Questions