Question

I need to understand how can i use java script in load runner.

I am recording one of web application in which java scripts doing some calculations on login page and generating 2 different values(token no and token ID) which used to pass in login request along with user login id and password.

how can i capture these 2 values in load runner

Was it helpful?

Solution

In one of my GitHub projects I have a tutorial on how a LoadRunner C script call call functions in a JavaScript library. The example takes you step-by-step using an Agile approach.

Right now it's at: https://github.com/wilsonmar/LoadRunner/blob/master/random_birthdate_js/README.md

I chose the example of calculating data because that would involve many of JavaScript functions and data types.

Let me know what you think.

OTHER TIPS

Three options:

  1. Use TruClient as a Virtual User Type
  2. Take a look at your help file and the function "web_js_run()" and see whether this would be appropriate for your use and your version of LoadRunner
  3. Convert your JavaScript function to a C function (assuming you are using a C based Web virtual user) and then reference the function as you would any other
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top