Add Async rules
For a list of protocols that support asynchronous communication, see 64-bit recording, Async, and IPv6 support.
When VuGen scans a Vuser script after recording or regenerating the script, VuGen may fail to identify asynchronous conversations that are included in the Vuser script. In other cases, VuGen may erroneously classify a regular synchronous step as part of an asynchronous conversation.
You can define Async rules that determine how requests to specified URLs are classified during an Async scan. Async rules may be positive or negative.
Add a positive Async rule
-
Select Record > Recording Options > General > Code Generation and then click Async Options. The Asynchronous Options dialog box opens.
-
Under Asynchronous Regular Expressions, click Add Async Rule . The Add Rule dialog box opens.
-
From the Type list, select Push, Poll, or Long Poll, as required.
-
In URL Regular Expression, enter a regular expression for URLs that should be considered part of asynchronous conversations.
Special characters that you can include in a regular expression:
Expression Description . Any single character * Zero or more + One or more ? Zero or one ^ Beginning of line $ End of line \n Line break \r Carriage return [] Any one character in the set [^] Any one character not in the set \w Word character \W Non-word character \d Decimal digit \D Non-decimal digit | Or \ Escape special character To include characters such as “?” and “+” in the regular expression, insert a backslash “\” before the required character.
-
Click OK. The new rule appears in the list of Async rules for the Vuser script.
When you regenerate the script:
- For each push conversation that includes a URL that matches the regular expression, VuGen inserts asynchronous API functions into the Vuser script, but does not remove any of the recorded code from the Vuser script.
- For each polling or long-polling conversation that includes a URL that matches the regular expression, VuGen inserts asynchronous API functions into the Vuser script, and may remove steps or step parameters from the generated Vuser script. VuGen removes steps or step parameters in cases where the relevant URLs are requested by running the inserted asynchronous functions - and not by running the original steps that have been removed.
For further details, see How VuGen modifies a Vuser script for asynchronous communication.
Add a negative Async rule
-
Select Record > Recording Options > General > Code Generation and then click Async Options. The Asynchronous Options dialog box opens.
-
Under Synchronous Regular Expressions, click Add Async Rule. The Add Asynchronous Rule dialog box opens.
-
From the Rule Type list, select Not Async.
-
In URL Regular Expression, enter a regular expression for URLs that should not be considered part of asynchronous conversations. Refer to the table above for a list of special characters that you can include in a regular expression.
To include characters such as “?” and “+” in the regular expression, insert a backslash “\” before the required character.
-
Click OK. The new rule appears in the list of Async rules for the Vuser script.
When you regenerate the script, steps that contain URLs that match the regular expression are not included in asynchronous conversations.
See also: