lr.think_time
Pauses execution between commands in a script.
void lr.think_time( double thinkTime );
| Runtime Functions | Java Syntax |
Arguments
| Name | Comments |
|---|---|
| thinkTime | The length of the pause, in seconds. |
lr_think_time allows you to pause test execution during a run. This is especially useful in simulating think time, the time a real user pauses to think between actions.
When using cross-step downloads or asynchronous functions of any kind, a long think time may cause the download to time out.
Return Values
No value is returned.
Parameterization
You cannot use standard parameterization for any arguments in this function.
Example
In the following segment, lr.think_time instructs the script to pause for 1 second before printing the Vuser ID string.
In this example lr.get_transaction_duration, checks the duration of part of a transaction, and sends it to the Output window.
int status;
lr.start_transaction ("Flight");
web.url("home;sz=234x60;tile=1;ord=977672495775323400",
"URL=http://ad.doubleclick.net/...ord=977672495775323400", new String[] {
//...
"Mode=URL",
web.LAST});
// Get transaction time to this point
think_time=lr.get_transaction_think_time("Flight");
status = web.submit_data("flight",
"Action=http://www.Web-tours.com/cgi-bin/tours?ITN_RESPONSE+", new String[] {
"Method=POST",
"TargetFrame=",
//...
web.LAST}, new String[] {
"MY DATA",
//...
web.LAST}); /* End transaction with operation result - pass or fail */
if (status == 0)
lr.end_transaction("Flight", lr.PASS);
else
lr.end_transaction("Flight", lr.FAIL);
if (think_time > 0)
lr.output_message("The transaction think time is" + think_time + "seconds.");
else
lr.output_message("The think time cannot be determined.");

