Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and Web Services Vuser scripts.
The LoadRunner API includes several functions that enable Vuser scripts to emulate asynchronous communication. These asynchronous communication functions are:
This function registers the next action function as the beginning of an asynchronous conversation, and defines the behavior of the asynchronous communication.
This function cancels the specified asynchronous conversation, including all its active and future tasks.
This function suspends the Vuser script execution until the specified parameter is defined.
This function sets the specified string to be the request URL for the next request sent in the conversation. This is applicable only when called from a callback.
This function sets the specified string to be the request body for the next request sent in the conversation. This is applicable only when called from a callback.
This function is similar to the web_util_set_request_body function. However, this function is included as part of a Flex protocol asynchronous conversation instead of a Web(HTTP/HTML) protocol asynchronous conversation. This function expects an XML formatted request body, which will be converted before the request is sent.
For details on the asynchronous API functions, see the Function Reference (Help > Function Reference).
The web_reg_async_attributes function should be called before the step that starts the asynchronous conversation. The web_reg_async_attributes function receives a number of arguments that define the asynchronous conversation. One of these arguments is the URL of the asynchronous conversation. As soon as the replay engine downloads this URL in the step that follows the web_reg_async_attributes function, the asynchronous conversation begins. The callbacks that are registered in the web_reg_async_attributes function enable the script developer to control some of the characteristics of the asynchronous conversation (for example, to change the URL). The asynchronous conversation continues until the web_stop_async step, or until the end of the iteration. In a push-type conversation, the server may close the connection and thereby end the conversation.
Note: Async functionality is not supported when you replay a Vuser script in WinINet mode.
For details on how the asynchronous functions differ from synchronous functions, see How Asynchronous Functions Differ from Synchronous Functions.