Generating a Title-Verification Function

The WebVerifyHtmlTitle function checks the titles (contents of HTML <title> tags) of selected HTML pages. No text selection is required to apply title verifications.

  1. In the menu tree, select the Web page that you want to verify.
  2. Perform one of the following steps:
    • Choose Script > Verify Page Title .
    • Click Add Verifications and then click Verify page title on the Workflow - Add Verifications dialog box.
    The page title is included in the constant value text box, and the constant value option button is selected.
  3. 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.
  4. From the Verify that the page title list box, select one of the following choices:
    • is equal to
    • is different from
    • contains
    • does not contain
  5. Check the relevant check boxes to make the verification case-sensitive or to apply it as a script-wide rule.
  6. In the Severity group box, specify the severity that should be raised if the verification returns a negative result.
  7. Click OK. The function is then added to your test script.

Code Example

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

transaction TMain 
begin
  ...
  WebVerifyHtmlTitle("ShopIt - Greetings", 
    WEB_FLAG_IGNORE_WHITE_SPACE | 
    WEB_FLAG_EQUAL | WEB_FLAG_CASE_SENSITIVE, 1,
    SEVERITY_ERROR, bVerifyTitleSuccess1);
  WebPageUrl("http://myHost/shopit");
  ...