Note: This topic applies to Web (HTTP/HTML), Mobile Application - HTTP/HTML, Flex, and Web Services Vuser scripts.
To build a Vuser script for an asynchronous application, perform the following:
- Click the New Script button on the VuGen toolbar.
- Select Web - HTTP/HTML, or one of the other Vuser protocols that support asynchronous communication.
- Click Create. VuGen creates a basic Vuser script.
- Select Record > Recording Options.
- Under General, select Code Generation.
- Make sure that the Async Scan check box is selected. This instructs VuGen to scan the Vuser script after recording, locate asynchronous communication, and insert the appropriate asynchronous functionality.
- Click Record on the VuGen toolbar.
- Enter the required information in the Start Recording dialog box, and then click Start Recording.
Perform the business processes that the Vuser will emulate, and then click Stop Recording on the floating toolbar.
Note: In order for VuGen to be able to successfully identify the asynchronous behavior in a Vuser script, the asynchronous communication must contain at least the required minimum number of client requests and server responses. For details, see Types of Asynchronous Communication.
- After you click Stop Recording, VuGen generates the Vuser script.
- After generating the script, VuGen scans the generated script to locate instances of asynchronous communication.
- If VuGen locates any instances of asynchronous communication, VuGen will modify the script to enable the script to run and emulate the asynchronous behavior. For details, see How VuGen Modifies a Vuser Script for Asynchronous Communication.
- The Design Studio opens. Click the Async tab. The Async tab displays a list of all instances of asynchronous communication that VuGen located in the Vuser script.
For each asynchronous conversation that appears in the Async tab of the Design Studio, perform the following tasks:
- Open the Vuser script in the Editor.
- Locate the web_reg_async_attributes step that starts the asynchronous conversation. Ensure that the web_reg_async_attributes step is located at the start of the asynchronous conversation.
Make sure that the URL parameter in the web_reg_async_attributes step is the same as one of the URLs that are specified in the action step that follows the web_reg_async_attributes step.
For details on the web_reg_async_attributes step, see Defining the Start of an Asynchronous Conversation.
Notice that the step comment before the web_reg_async_attributes step contains a TODO token. The TODO token indicates that you should check the relevant callback implementations in the AsyncCallbacks.c extra file.
- Locate the web_stop_async step that ends the asynchronous conversation. Ensure that the web_stop_async step is located at the end of the asynchronous conversation.
Make sure that the web_stop_async step runs as required. For details, see Fine-Tuning the End of an Asynchronous Conversation.
For details on the web_stop_async step, see Defining the End of an Asynchronous Conversation.
- Review the callback implementation and make modifications to the script as required. For details, see Implementing Callbacks.
- Make sure that all counter and complex string parameters are set correctly. Notice that for each such parameter, a TODO comment exists and has a matching task in the Tasks pane. For details, see Parsing URLs.
Check the Tasks pane for specific actions that are required in order to complete the script development process. Such actions may include verifying callback implementations, or verifying the implementation of specific parameters.
- Once all parameters are initialized correctly, run the script to make sure that the asynchronous conversation runs as expected.
Note: Async functionality is not supported when you replay a Vuser script in WinINet mode.
Once you have reviewed the modified script and made sure that the asynchronous communication has been implemented correctly, run the script. For details, see Enabling Asynchronous Scripts to Run.