Adding Async Rules

Note: Applies to Web - HTTP/HTML, Flex, and Web Services Vuser scripts.

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 will be classified during an Async scan. Async rules may be positive or negative.

Adding a positive Async rule

  1. Select Record > Recording Options > General > Code Generation and then click Async Options. The Asynchronous Options dialog box opens.

  2. Under Asynchronous Regular Expressions, click Add Async Rule . The Add Rule dialog box opens.

  3. From the Type list, select Push, Poll, or Long Poll, as required.

  4. 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:

    To include characters such as “?” and “+” in the regular expression, insert a backslash “\” before the required character.

  5. 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 will be 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.

Back to top

Adding a negative Async rule

  1. Select Record > Recording Options > General > Code Generation and then click Async Options. The Asynchronous Options dialog box opens.

  2. Under Synchronous Regular Expressions, click Add Async Rule. The Add Asynchronous Rule dialog box opens.

  3. From the Rule Type list, select Not Async.

  4. In URL Regular Expression, enter a regular expression for URLs that should not be considered part of asynchronous conversations.

    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.

  5. 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 will not be included in asynchronous conversations.

Back to top

See also: