Wednesday, February 2, 2011

LoadRunner - lr_vuser_status_message function

There are situations during load testing when you want to find out which data(i.e. username) was consumed by a VUser(For example, Few VUser were having errors). If you don't have proper logging turned on(or a code) during load testing, it can be a pain. One way of getting data information is to use lr_vuser_status_message function.

From LR Help "The lr_vuser_status_message function sends a string to the Status area of the Controller. It also sends this string to the Vuser log. When run from VuGen, the message is sent to output.txt"

For example, In the error log(Controller) you can find out which VUser had an error and using lr_vuser_status_message function you can then find out what data that VUser was using. This way it helps save time in debugging any data related issues.

Following example shows how to use lr_vuser_status_message function.

In the code above, UserName parameter string is passed into the lr_vuser_status_message function.

Now during load testing if you open VUser window in controller, following is what you will see.

From the image above you can notice the UserName(Status column) that each VUser is using in current iteration.

Now if you have an error in the error log, find out which VUser had the error and open up VUser window to find out what data that Vuser was using. It won't tell you what caused the error but will give you enough information to start investigating.


performanceqa said...

What is the exact location for keeping this function in the script and why we need to use think time for 600 sections (Please reply back to

hseera said...

Hi Performanceqa,

Following is the answers to your questions:

1:What is the exact location for keeping this function in the script?
Ans: You want to keep the function in a section that is executed every iteration. For example, in my case the "Action" is executed every iteration. Also parameter is set to have a new value for each iteration.

2:Why we need to use think time for 600 sections?
Ans: I had this set to 600 second because I wanted to have enough time to take a screenshot. It is not required in this code.

performanceqa said...

Got it. thank you so much for quick reply. i never expected