Friday, July 26, 2013

How to Change the TimeOut on LoadRunner

This is a very common issue when executing a scenario, meaning basically that the server has not responded in a specified amount of time. LoadRunner defaults to 120 seconds on all Web based protocols (HTTP, WebServices, Click & Script), but this can be easily changed using a command on the begging of the script, web_set_timeout.

The command have only two parameters, the operation and the new value. The operation can be one of these three:

CONNECT: To establish the connection to the Web server.
RECEIVE: Time–out on the next “portion” of server response to arrive.
STEP: Time–out on each VuGen step.

Usually the one we see expiring the most is STEP, for obvious reasons. The error message should look something like “Step Download Timeout”.

The second parameter is the new value, expressed in seconds. So if we want to set up a new value for STEP we have to insert this code in the beginning of our action:

web_set_timeout("STEP","240");
Being 240 seconds our new value.

Usually I change the timeout value of all three operations, just to be sure:

web_set_timeout("STEP","240");
web_set_timeout("CONNECT","240");
web_set_timeout("RECEIVE","240");

We just have to be careful when changing this configuration, because the default value is already too high for most user actions.
This should only be used in two cases:
When we really expect a transaction to be slow, like a large report or file upload, something that the users already expect to be slow;
Also when we need to troubleshoot a slow transaction, meaning, waiting for a longer period to get the response.

No comments: