-1

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

AmarjeetM
  • 1
  • 1
  • 3
  • http://h30499.www3.hp.com/t5/HP-LoadRunner-and-Performance/How-to-use-JavaScript-in-your-HP-LoadRunner-scripts/ba-p/6197321#.U1paS1WSzPU – Tuhin Apr 25 '14 at 12:54

2 Answers2

0

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
James Pulley
  • 5,606
  • 1
  • 14
  • 14
0

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.

Wilson Mar
  • 130
  • 3
  • 8