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. In contrast to the function WebVerifyTable, the row number is determined dynamically through the content of a search column. 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
WebVerifyTableVLookup( in nTableNum : number, in nSearchColumn : number, in sSearchText : string, in nSearchOptions : number, in nResultColumn : number, in sVerify : string, in nResultOptions : 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. |
nSearchColumn | Specifies, in which column to look for sSearchText. |
sSearchText | The search text identifies the correct row. If multiple rows match the search text, the verification is performed for the first matching row. |
nSearchOptions |
|
nResult Column | Specifies the column of the cell to verify. |
sVerify | String to compare with the parsed cell. |
nResultOptions |
(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). |
/* Table #3 on the page: Number Name Price 1000 3 Person Dome Tent $ 299.99 1001 External Frame Backpack $ 179.95 1002 Glacier Sun Glasses $ 67.99 1003 Padded Socks $ 19.99 1004 Hiking Boots $ 109.90 1005 Back Country Shorts $ 24.95 */ transaction TMain var bResult : boolean; begin WebVerifyTableVLookup(3, 1, "1003", WEB_FLAG_EQUAL, 2, "Padded Socks"); WebPageUrl("http://demo.borland.com/gmopost/online-catalog.htm", "OnLine Catalog"); WebVerifyTableVLookup(3, 1, "003", WEB_FLAG_CONTAINS, 2, "Padded Socks", WEB_FLAG_EQUAL, NULL, SEVERITY_ERROR, bResult); WebPageUrl("http://demo.borland.com/gmopost/online-catalog.htm", "OnLine Catalog"); if not bResult then print("Verification failed"); end; WebVerifyTableVLookup(3, 1, "1003", WEB_FLAG_EQUAL, 2, "wrong text", WEB_FLAG_CONTAINS_NOT, NULL, SEVERITY_ERROR, bResult); WebPageUrl("http://demo.borland.com/gmopost/online-catalog.htm", "OnLine Catalog"); if not bResult then print("Verification failed"); end; end TMain;