Share this page

# web.sync

Example | Asynchronous Functions - JavaScript

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" runtime 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" runtime setting. Regardless of the value of this argument or of the "web.sync retry timeout" runtime setting, the timeout never exceeds the value of the "Step download timeout" runtime 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 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.

## Example

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

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: