AJAX Click and Script Functions > Syntax Guidelines

Syntax Guidelines

Support for the Click & Script protocols will be discontinued in an upcoming version.

This section contains general guidelines to understanding the syntax and coding of AJAX functions.

The Argument List

Function arguments are divided into sections by delimiter arguments: DESCRIPTION, ACTION, and LAST. The function argument lists have three main sections:

With the exception of stepname, which is identified by its being the first argument, all the function's arguments are identified by their keyword. For example, BrowserTitle is specified with this format: "BrowserTitle=Welcome to Pemberley".

The first argument is always the stepname, even if the format looks like "KeyWord=Value". It other words, if you enter "BrowserTitle=Welcome to Pemberley" as the first argument, the stepname is "BrowserTitle=Welcome to Pemberley".

Coding Guidelines

Delimiters (DESCRIPTION, ACTION and LAST) are entered in capital letters and without quotation marks.

Always include the LAST delimiter.

Keywords are not case sensitive. For example, "WindowType=PopUp" and "WINDowtYpe=PopUp" are equivalent.

Do not enter white space before or after a keyword. For example, " WindowType =PopUp" is not recognized.

Values that are limited to a predefined list (for example, Regular , Modeless, or PopUp, which are the predefined values for WindowType) are not case sensitive. For example, "WindowType=REGULAR" and "WindowType=RegulaR" are equivalent.

Values that are not limited to a predefined list, however, are sometimes case sensitive.

Do not enter leading or trailing white space unless it is part of the value. For example, "Name= submit_button " (with spaces) is not equivalent to "Name=submit_button".

Parameterization only applies to values, for example, "WindowType={WinTypeParam}". You cannot parameterize the entire argument (Keyword=Value) or the keyword part of the argument. Neither "{KeywordEqValueParam}" nor "{KeywordParam}=value" is recognized.

Usually, specifying an argument as an empty string is not equivalent to omitting it. For example, specifying "Name=" in the DESCRIPTION section restricts the matches to elements with an empty or omitted name, whereas if the Name descriptor is not passed to the function, element identification is based on the other descriptors and the name of the element is ignored.

Normalization of Arguments

During the recording process and when regenerating a script, VuGen normalizes the argument values:

For example, during the recording process, if you clicked on a button whose HTML definition contains name=" ab\r\nc ", the spaces and \r\n are removed, so that the argument in the VuGen script is "Name=abc". As a result, the argument value "abc" as it appears in the VuGen script does not appear as the button name in the log files or the HTML source of the web page.

If normalization causes a problem, use a parameter or program constant for the value. Do not simply edit the recorded value because your correction will be lost if you regenerate the script.

Regular Expressions (REs)

If the keyword is of the form Keyword/RE, the argument can take a regular expression as its value.

For more information, see Regular Expressions.