How to Capture Dynamic Value Using truclient protocol in Load Runner
- To Capture dynamic value/text on web application page, We use ‘Get property’ intruclient scripting. Please follow below steps :-
- Here for example, I am using URL(http://newtours.demoaut.com/ )and creating a flight reservation. The Flight confirmation number is dynamic “Flight Confirmation # 2019-04-23113627”.
- After recording find the step where the confirmation number is showing on the screen.
- Go to Tool Box and select the “Generic object action” from Function.
- It will ask to Click to Choose an object. Now select the value which we are going to capture.In my case I will select the Flight Confirmation Number. As you can see I have highlighted the value on which I am going to capture.
- Expand the step and change Action from click to “Get Property“.
Open the “Arguments”. Select the property as”Visible Text” and declare the variable name.
Open the Object. Select the “ID Method” as “XPath and select the appropriate Xpath.
- To verify if the above configuration is correct, open the Toolbox again and add one more step. Drag the step “Evaluate JavaScript” from the “Miscellaneous” area after the step just created above.
TC.log(“The Reservation Number is ” + ReservationNumber);
- Write TC.log(ReservationNumber) to display the value in logs;
- For passing this value to the next request simply go to arguments and paste this string variable and select the Type as JS.
Isha training solutions is offering a ”TruClient Protocol Using LoadRunner” level course. For complete details, pls follow below link