Generating an HTML Data-Digest Verification Function

The WebVerifyDataDigest function calculates a Web page digest and then subsequently verifies content against the precalculated digest. In the case of HTML or XML source code, a digest consists of a character-frequency table, which is calculated for certain characters in a page-response body.

  1. In the menu tree, select the Web page that you want to verify.
  2. Open Source view.
  3. Perform one of the following steps:
    • Choose Script > Verify Page Digest .
    • Click Add Verifications and then click Verify digest on the Workflow - Add Verifications dialog box.
    A name for the digest is displayed in the Constant name text box.
  4. Optional: Edit the Constant name text box.
  5. In the Verify group box, specify how the verification should be applied:
    • All characters
    • Printable characters
    • Alphanumeric characters
  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 data digest verifications:

const 
  DATA_DIGEST_1     := 
"\h019200000000E7FBEFFFAEF7FD2AFEFFFF2B000000000000000000000000000000004
F06040072000800020038000600060002"
"\h0006000A0035004B0024000E00050001000100010001000200010002000F0059005A0
058000100030007000300020003000100"; 
"\h1200010001000600020003000100150013000200010001000300010003000300A1002
30047003E00BA002100710056009B0001"
"\h000D0062003C00620079003E000300AE006D00BC0023000E002C0005000E000200020
0";

transaction TMain
begin 
  ...
  WebVerifyDataDigest(DATA_DIGEST_1, 188, 0, 0, 1, 
    SEVERITY_ERROR);    
  WebPageUrl("http://lab3/ShopItV60/default.asp", "ShopIt - Greetings");
  ...