Parses HTML tables and compares its cell content with the provided string. If it does not match, an error is raised. The severity of this error can be specified. The verification result can be retrieved by an optional out-parameter. A subsequent low-level function will not return a value until the request has finished.
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 (Profile Settings / Web / Verification / HTML / Table verification).
WebAPI.bdh
WebVerifyTable( in nTableNum : number, in nRow : number, in nColumn : number, in sVerify : string, in nOptions : number optional, in sFrame : string optional, in nSeverity : number optional := SEVERITY_ERROR, out bSuccess : boolean optional );
none
Parameter | Description |
---|---|
nTableNum | The nTableNum th table is checked. |
nRow | Specifies the row of the cell to verify. |
nColumn | Specifies the column of the cell to verify. |
sVerify | String to compare with the parsed cell. |
nOptions |
(optional)
|
sFrame | Frame that gets searched for the specified table (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 WebVerifyTable(1, 3, 4, "1200"); WebPageUrl("http://mycompany.com/"); WebVerifyTable(2, 1, 1, "error", WEB_FLAG_CONTAINS_NOT, "FrameRight", SEVERITY_WARNING, bResult); WebUrl("http://mycompany.com/Shop/default.htm"); if not bResult then print("Verification failed"); end; WebVerifyTable(2, 2, 2, "sum"); WebVerifyTable(3, 2, 3, "1455"); WebPageUrl("http://mycompany.com/frame/framea.html"); end TMain;