Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and Web Services Vuser scripts.
The following example describes a Vuser script that includes a poll asynchronous conversation. The application that is emulated by the Vuser is a demo of a “wiki” page. The browser displays the wiki page, and sends requests to refresh the page at intervals of 5 seconds.
Note: You can modify VuGen's asynchronous request thresholds to assist VuGen in finding poll-type conversations. For details, see Using Asynchronous Request Thresholds.
The above script was generated by VuGen after the required business processes were recorded. An asynchronous scan was not performed on the script after the script was generated. Notice that the script contains a series of web_url functions with a repeating URL, namely: http://example.com/content.php?messages. These web_url functions are separated by lr_think_time functions, indicating that the web_url functions repeat at intervals of 4 seconds.
When the Vuser script runs, requests for http://example.com/content.php?messages should be sent repeatedly until the script is finished. Additionally, these requests should be sent in parallel (simultaneously) with other actions performed in the Vuser script.
After VuGen performed an asynchronous scan on the script, the script looks as follows:
Notice that a web_reg_async_attributes function has been added to the script before the first web_url function that calls http://example.com/content.php?messages.
Except for the first call to http://example.com/content.php?messages, all other web_url functions that call the same URL have been commented-out by VuGen.
Notice that the lr_think_time functions have been merged into one lr_think_time function.
The Snapshot pane for the remaining web_url function shows that the snapshots for the removed web_url functions now have Origin = Polling, and that they start at intervals of 5 seconds.
Since the requests also have a response time, the think time in lr_think_time functions between the polling steps in the original script has been rounded down to 4 seconds.