Similar to the verification functions, parsing functions are used to parse content returned from a Web server and check if
the values meet your testing criteria. Different from the verification functions, which basically check the occurrence of
a specified input value, the parsing functions parse the content of a server response and return the parsed value in a BDL
variable. Typically, you will use parsing functions for the following tasks:
- Parse session IDs and replace static session IDs in the script with parsed, dynamic session IDs to maintain state information
in Web applications. This is one of the main fields of application of parsing functions.
- Build enhanced verifications into your script with parsing functions, which cannot be done with verification functions. For
example, if you want to verify that the value of column 2 of row 3 in an HTML table is equal to the sum of the values of column
2 of row 1 and column 2 of row 2. By using parsing functions to parse out the three values and compare them in our script,
you can build this enhanced verification check.
- Conditional execution of parts of your testing script which depends on the data returned from the server. For example, an
HTTP request returns an HTML page which includes:
Results: <nnn> items found. You want to execute different actions depending on the value of
<nnn>. Let's say you want to exit the transaction if
<nnn> = 0, and you want to go to link
Details if
<nnn> = 1, and you want to go to link
Next if
<nnn> is greater than 0. To accomplish this, you need to parse the value of
<nnn> from the HTML page and script the actions, depending on the value you have parsed out.
Silk Performer offers two means to enhancing your test scripts with parsing functionality: