Thursday, May 2, 2013

How to get iteration number of the current running iteration?

Hey friends, sometimes we have to know the current iteration number, while running the test. We can get the current iteration number by using LR parameter of 'Iteration Number' type.

Step 1: Go to tab Vuser > Parameter list and create parameter setting name as ‘current_ itr’ and select its type Iteration.

Step 2: Click 'Close' button in 'Parameter List' dialog.
Step 3:  Now, we have to insert the below code into LR script lr_output_message("Current iteration number is: %s", lr_eval_string("{current_ itr}"));

Click here to know more
Bingo! Script is ready to be served. Just a bit of garnishing is required to make it fool proof. Press F4 runtime settings window opens go to run logic tab and set the number of iterations to 6(my lucky number ;)). Click ok and press F5 and see the results in the replay log.

No comments:

Post a Comment