WebVerifyHtmlDigest Function

Action

Checks whether the HTML content that Silk Performer receives differs from a prior test. As TrueLog Explorer does, Silk Performer generates a digest, containing information about the occurrence of each character of the HTML content, and compares the results with the digest generated by TrueLog Explorer. When verifying HTML page that consists of multiple frames (HTML documents), you can specify which frame document to verify by specifying the sFrame parameter. By default the whole page is scanned. For a detailed explanation of the digest calculations see WebVerifyDataDigest.

Include file

WebAPI.bdh

Syntax

WebVerifyHtmlDigest( in  sDigest     : string,
                     in  nDigestLen  : number,
                     in  nDifference : number optional,
                     in  nOptions    : number optional,
                     in  sFrame      : string optional,
                     in  nSeverity   : number optional := SEVERITY_ERROR,
                     out nActDiff    : number optional ) : boolean;

Return value

  • true if the parsing modifier was created successfully.

  • false otherwise.

Parameter Description
sDigest Digest generated by TrueLog Explorer.
nDigestLen Size of the digest generated by TrueLog Explorer. Specify STRING_COMPLETE for the complete digest.
nDifference Upper tolerance level for the response verification (optional). For each digest entry, this function calculates the difference between the TrueLog Explorer and the Silk Performer digests. Finally, this function calculates the sum total of the differences of the TrueLog Explorer and the Silk Performer digests. If this sum total is greater than the tolerance level you specified, Silk Performer reports it as an error. If you want to ensure that both the TrueLog Explorer and the Silk Performer digests are compatible, you must specify a negative value (e.g.: -1). If you do not specify a value, or if you set it to zero, the default setting will be used instead.
nOptions

(optional)

WEB_FLAG_DONT_FORCE_LOAD
Specify this option to enable caching for the subsequent request. Note that this may lead to unpredictable behaviour, because the verification may only cover certain parts (which are loaded) of a page.
sFrame Frame that gets scanned (optional). If this parameter is omitted the whole page is scanned.
nSeverity Optional: Severity of the error that is raised if the verification fails. Can be one of the following values:
  • SEVERITY_SUCCESS: Success; no error (numerical value: 0)
  • SEVERITY_INFORMATIONAL: Informational; no error (numerical value: 1)
  • SEVERITY_WARNING: Warning; no error (numerical value: 2)
  • SEVERITY_ERROR: (Default) Error; simulation continues (numerical value: 3)
  • SEVERITY_TRANS_EXIT: Error; the active transaction is aborted (numerical value: 4)
  • SEVERITY_PROCESS_EXIT: Error; the simulation is aborted (numerical value: 5)
nActDiff The calculated difference between the digests generated by TrueLog Explorer and by Silk Performer at the actual run (optional).

Example

Const
  // generated by TrueLog Explorer
  HTML_DIGEST_1 :=
  "\h014100000000012000008AA2D9017AFBFD03000000000000000000000000000000004A03"
  "\h0101020401010408030201010606051904070A0405040910080F0C140502010101"; dcluser  user
    WebUser  transactions
    TWeb : 1;  dcltrans
  transaction TWeb
  begin
    WebVerifyHtmlDigest( HTML_DIGEST_1, STRING_COMPLETE, 0, 0, NULL, SEVERITY_ERROR);
    WebPageUrl("http://mycompany.com/");
  end TWeb;