Generating an HTML Data-Verification Function

The WebVerifyData function verifies selected data, such as code or text, in Source view. TrueLog Explorer automatically detects the number of occurrences of selected data in selected HTML documents.

  1. In the menu tree, select the Web page that you want to verify.
  2. Select the relevant data in Source view.
  3. Perform one of the following steps:
    • Choose Script > Verify Selected Text .
    • 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.
  4. Optional: To verify against an existing parameter or a new parameter, click the parameter value option button.
    1. Click [...] to browse to and select a parameter.
    2. If no parameters exist, click Next to open the Parameter Wizard and create a new parameter.
  5. Specify the frequency by which the selected text is to appear, as follows:
    1. From the Occurs list box, select one of the following choices:
      • exactly
      • at least
      • at most
    2. Type a number in the time(s) in this page text box.
  6. 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.
  7. Optional: Edit the Result variable name.
  8. Ensure that the Require boundary strings check box is unchecked.
  9. In the Severity group box, specify the severity that should be raised if the verification returns a negative result.
  10. Click OK. The function is then added to your test script.

Code Example

The following sample code (in bold) is generated automatically for data verifications:

transaction TMain 
begin
  ...
  WebVerifyData("main.asp?from=welcome", 1, 
    WEB_FLAG_IGNORE_WHITE_SPACE |  
    WEB_FLAG_EQUAL | WEB_FLAG_CASE_SENSITIVE, 1, 
    SEVERITY_ERROR, nVerifyDataResult1);
  WebPageUrl("http://myHost/shopit/", "ShopIt - Greetings");
  ...