Parsing functions are typically used for the following tasks:
- Replacing static session IDs in scripts with dynamic session IDs that maintain state information.
- Building enhanced content verifications into scripts that can not be achieved with verification functions alone. For example,
a parsing function might verify that a value in column 2 of row 3 of a database table is equal to the sum of the values in
column 2 of row 1 and column 2 of row 2. This can be achieved by generating parsing functions that parse out the three values
and compare them in a script.
- Conditionally executing part of a testing script that is dependent on data returned from a server. For example, an HTTP request
returns an HTML page that includes the following results:
<nnn> items found. Different actions need to be executed against the value
<nnn>. Say the transaction is designed to:
- Exit if
<nnn> = 0.
- Link to a details page if
<nnn> = 1.
- Link to the next page if
<nnn> is greater than 1.
To accomplish this, the value
<nnn> must be parsed from the HTML page, and scripted actions must be run based on the parsed values.
TrueLog Explorer allows you to insert parsing functions visually in
Rendered and
Source views.
TrueLog Explorer automatically generates parsing functions in scripts, so no manual writing of code is required.
TrueLog Explorer offers wizards that add parsing functions to your scripts to parse control values at any time during an application's life
cycle. To add a parsing function, right-click in the
Value column of a control that you wish to parse and select the relevant context menu.