JavaScript Functions > Alphabetical Listing of Web Functions > web.sync

web.sync

Example Asynchonous Functions

Suspends the Vuser script execution until the specified parameter exists.

Syntax

web.sync ( {object} );

JavaScript Object

{
   paramCreated: "<string>",
   retryIntervalMs: <milliseconds>,
   retryTimeoutMs: <milliseconds>,
}
Property Name
Description
paramCreated The name of a parameter.
retryIntervalMs

The number of milliseconds to wait before a retry after a test of the condition yielded false. The default is 500.

The default can be overridden by the "web.sync retry interval" run-time setting.

retryTimeoutMs

The maximum number of milliseconds during which retries are allowed. The default is 30000.

The default can be overridden by the "web.sync retry timeout" run-time setting.

Regardless of the value of this argument or of the "web.sync retry timeout" run-time setting, the timeout never exceeds the value of the "Step download timeout" run-time setting.

Return Values

This function returns lr.pass (0) if the specified parameter exists, and lr.fail (1) if the step times out.

Parameterization

You can use standard LoadRunner parameterization with all string values in JavaScript objects.

General Information

The parameter named in the paramCreated argument is expected to be created by a concurrent activity, such as a poll or a push conversation. If the parameter has already been created when the function is invoked, it returns immediately. If not, the script run is suspended until either the parameter is created or the function times out.

 

Concept Link IconSee Also

Example

 web.sync({paramCreated:"ready_param",retryIntervalMs:3000, retryTimeoutMs:120000});