Parameterization: Parameterization are script variables. It is the method to pass different data values in the VuGen script or to emulate real user data. For more details: http://goo.gl/enFv7r
More than Just Lines on a Map: Best Practices for U.S Bike Routes
How to parameterize the values in ajax tru client scripts using loadrunner
1. How to Parameterize the values in Ajax TruClient
scripts using LoadRunner?
Parameterization:
Parameterization are script variables. It is the method to pass different data values in the VuGen
script or to emulate real user data entering action which is sent to the server each time the script is
ran. In TruClient scripts the parameterization is defined in the step argument part of the step.
As mentioned before, the step arguments accepts JavaScript code as values, follow the below
mentioned steps for parameterization:
1. Method 1 : Using LoadRunner functionality
1. In this method parameterization can be done like the way it is done in other protocols.
2. Click on Open/Close the step editor button of the step where parameterization needs to be
done.
3. Click on Arguments.
4. Select the value displayed corresponding to the field *Value à Right Click à Select Create
New parameter from selection.
5. Enter parameter details in Enter Parameter Name dialog box and click on ok.
2. 6. Parameters can be created and referenced with step argument or Eval Javascript step.
7. Syntax to define parameter: LR.getParam(“ParamName”);
8. Syntax to update the value of already defined parameter:
LR.setParam(“ParamName”,“OtherValue”);
2. Method 2: Using JS code
1. For e.g. the server name of the application needs to be parametrized and also the
testing needs to be done on various servers. Following steps can be implemented
in such kind of scenarios.
2. Write the JS code in JS-functions.js script of the VuGen script.
3. The following example code is written to create different launch url’s where the
server names will be variable.
3. 4. Note that the getURL(); function will return the actual complete URL. Open the
script in develop mode and write the function name in the Arguments value.
5. Save the script.