Parses the HTML response data and verifies the specified string within the boundaries. If the verification condition is not met, an error is raised. The severity of this error can be specified. The result of the verification can be retrieved by an optional out-parameter. A subsequent low-level web function will not return a value until the request has finished. A cache hit is not performed unless the WEB_FLAG_DONT_FORCE_LOAD option is set. The verification is done even if this option is set and the verified request or a certain part of a page is a cache hit.
When verifying/parsing an HTML page that consists of multiple frames, you can specify which frame document to verify/parse by specifying the sFrame parameter. By default, all HTML documents of the HTML page are scanned. This applies to HTML pages that are retrieved through a page-level command like WebPageUrl or WebPageLink.
It is important to know that all parsing and verification functions must be specified before the Web API call for which the response data should be parsed/verified. You can specify multiple parse/verification functions before a Web API call. The order of the parse/verification functions is not relevant (Exception: WebParseDataBound and WebVerifyDataBound using the flag WEB_FLAG_SYNCHRON).
This verification feature can be enabled/disabled globally (
).WebAPI.bdh
WebVerifyHtmlBoundEx( in sLeftBoundary : string, in nLeftOccurrence : number, in sRightBoundary : string, in sVerify : string, in nOptions : number optional, in sFrame : string optional, in nSeverity : number optional := SEVERITY_ERROR, out bSuccess : boolean optional );
none
Parameter | Description |
---|---|
sLeftBoundary | Left boundary of the HTML content to compare. |
nLeftOccurrence | The sLeftBoundary has to be found nLeftOccurrence times, before the verification process starts and the right boundary is searched (optional). The default value is one. Provide WEB_OCCURENCE_LAST to specify the last occurrence. |
sRightBoundary | Right boundary of the HTML content to compare. |
sVerify | String to compare with the parsed HTML content. |
nOptions |
(optional)
|
sFrame | Frame that gets searched for the content (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:
|
bSuccess | If a variable is provided, it will receive the result of the verification (optional). |
dcltrans
transaction TMain
var
bResult: boolean;
begin
WebVerifyHtmlBoundEx("Begin", 2, "X.X", "End ");
WebPageUrl("http://mycompany.com/");
WebVerifyHtmlBoundEx("Begin", 2, "X.X", "End ", 0, NULL,
SEVERITY_WARNING);
WebVerifyHtmlBound("Shop", "City", "ing", WEB_FLAG_CASE_SENSITIVE);
WebUrl("http://mycompany.com/Shop/default.htm");
WebVerifyHtmlBound("Name:", "Age", "Smith",
WEB_FLAG_IGNORE_WHITE_SPACE, "Name", SEVERITY_ERROR, bResult);
WebPageUrl("http://mycompany.com/frame/framea.html");
if not bResult then Print("Verification failed"); end; end TMain;