web_global_verification

Searches for a text string in all subsequent requests.

int web_global_verification( <List of Attributes>, LAST );
Argument
Description
List of Attributes
Text: The text string to search for. This attribute must be a non–empty, null–terminated character string. Use the format "Text=string". You can further customize your search by using /Text Flags.
The following two attributes are used only when Text is not specified.
TextPfx: The prefix of the text string for which you are searching. Use the format "TextPfx=string". You can further customize your search by using /Text Flags.
TextSfx: The suffix of the text string for which you are searching. Use the format "TextSfx=string". You can further customize your search by using /Text Flags.
Search: >Where to search for the text. The available values are Headers, Body, NORESOURCE, or All. The default is NORESOURCE. This attribute is optional. Use the format "Search=value".
Fail: The handling option when the string is not found The available values are Found (default) and NotFound. Found indicates that a failure occurs when the text is found (e.g., "Error"). NotFound indicates that a failure occurs when the text is not found. Use the format "Fail=value"
ID: A identifying string used to denote this particular call to web_global_verification. For example, it is used in the log file and in calls to web_global_verification_pause.
LAST
A marker that indicates the end of the attribute list.

Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.

Parameterization

The following arguments can be parameterized using standard parameterization: Text, TextPfx, and TextSfx

General Information

The web_global_verification function registers a request to search for the specified text string in web pages return by all subsequent action functions. The script fails if the Fail condition occurs in any subsequent action function. This is in contrast to the web_reg_find function which only registers a request for the next Action function.

To suspend the check, use web_global_verification_pause. If more than one check is in force due to multiple calls to web_global_verification, call web_global_verification_pause for each check you want to suspend.

The web_global_verification function is useful in detecting application level errors that are not represented by HTTP status codes. To locate errors that are represented by HTTP status codes, use web_get_int_property.

You can search the body, headers, html code, or the entire contents of a page. The Search options are:

  • all: the entire HTML page

  • headers: only the its headers, not the body

  • body: the body, excluding all headers, but including all resources

  • NORESOURCE: only the html body, excluding all headers and resources (default)

If you do not know the exact text to search for, or if the text is not consistent, you can qualify it by its beginning and end, using the TextPfx and TextSfx attributes. The prefix and suffix are actually the boundaries of the text—TextSfx is the right boundary and TextPfx is the left boundary. When using these attributes, you must specify a non–empty value for both attributes, and the Text attributes must not be specified.

When "Fail = Found" is specified (or no Fail condition is specified) with TextPfx and TextSfx and the left and right boundaries are found more than once, each match is issued as an error up to the maximum number of errors configured in the Runtime Settings > Preferences > Advanced Options. Subsequent matches are logged as informational messages.