The
WebVerifyHtml function verifies selected text in
Rendered view.
TrueLog Explorer
automatically detects the number of occurrences of selected text in HTML
documents.
-
In the menu tree, select the Web page that you want to verify.
-
In
Rendered view, select the appropriate text.
-
Perform one of the following steps:
- Choose
.
- Right-click the
selected text and choose
Verify Selected Text.
- Click
Add Verifications and choose
Verify selected text in HTML page from the
Workflow - Add Verifications dialog box.
The selected text is displayed in the
constant value text box, and the
constant value option button is selected.
-
Optional: To verify against an existing parameter or a new
parameter, click the
parameter value option button.
-
Click
[...] to browse to and select a parameter.
-
If no parameters exist, click
Next to open the
Parameter Wizard and create a new parameter.
-
Optional: To make the verification more tolerant, adjust the
following settings:
Note: The settings on this dialog box are automatically set to values
that guarantee a successful verification for the current page. Only in cases in
which you want to make a verification more tolerant should these settings be
changed (for example, by changing "exactly"
"2" times to "at least"
"1" time, or by making a verification case-insensitive).
-
From the
Occurs list box, select one of the
following choices:
-
Type a number in the
time(s) in this page text box.
-
Check the relevant check boxes to make the verification
case-sensitive or to apply it as a script-wide rule.
A result variable name is displayed in the
Result variable name text box.
-
Optional: Edit the
Result variable name.
-
Ensure that the
Require boundary strings check box is
unchecked.
-
In the
Severity group box, specify the severity that
should be raised if the verification returns a negative result.
-
Click
OK.
The function is then added to your test script.
Code Example
The following sample code (in bold) is generated automatically for
HTML text verifications:
transaction TMain
begin
...
WebVerifyHtml("Hi Tester! ", 1, WEB_FLAG_IGNORE_WHITE_SPACE |
WEB_FLAG_EQUAL | WEB_FLAG_CASE_SENSITIVE, NULL,
SEVERITY_ERROR, nVerifyHtmlResult1);
WebPageSubmit("Enter", SHOPIT_MAIN_ASP001, "ShopIt - Main menu");
...