Parameterization in TruClient Protocol Loadrunner - JavaScript Based (Method 1 - TC.getParam)

Step 1 : Create a parameter under Parameters Dialog Box. I have created a File Parameter of name P_MPID. (Highlighted in RED)


Step 2 : Click the Develop Script button

Step 3 : Goto Tools --> Miscellaneous --> Evaluate JavaScript. Click and drag Evaluate JavaScript and place it above the step where the parameter P_MPID has to be passed. (Step Highlighted in BROWN - Last Image)



Step 4 : Fetch the parameters from P_MPID using TC.getParam function and assign it to the variable MPID. Follow the code in Arguments section. (Code Highlighted in RED)

Step 5 : Goto the step where the parameter P_MPID has to be passed and replace the original value with the variable MPID in Value field under Arguments section. (Highlighted in RED)

Step 6 : By default Value and Typing Intervals fields will be in Plain Text. Now click on the drop down arrow and select JavaScript <JS>. This has to be done because we are passing the parameter using JavaScript. (Highlighted in GREEN)



No comments:

Post a Comment