This function performs optical character recognition (OCR) on a selected screen region and compares the result with a provided string. When the verification condition is not met, an error is raised. You can specify the severity of the error. Screen regions can be specified absolutely or relative to a window (by specifying a window handle).
When optional font parameters are present, the pattern file is checked to see if the selected font is available. When font parameters are omitted font checking is not performed.
For successful text conversion it is necessary to use the perfOcrFonts.dat and perfOcrPattern.pat configuration files, which contain used fonts in the correct size and format. These files must be added to the Data Files section of the project (both files are located at <public user documents>\Silk Performer 20.5\Data). If the files are not available, or do not contain the correct specifications, they can be generated or updated using the OCR dialog in the Citrix System Settings.
CitrixAPI.bdh
CitrixVerifyText( in sVerify : string, in nWindow : number, in nX : number, in nY : number, in nWidth : number, in nHeight : number, in nOptions : number optional, in nSeverity : number optional := SEVERITY_ERROR, in sFont : string optional, in nFontSize : number optional, in nFontFlags : number optional ): boolean;
true if the function succeeds
false otherwise
Parameter | Description |
---|---|
sVerify | String to compare with the parsed data. |
nWindow | Window handle returned by a call to CitrixWaitForWindowCreation. Use DESKTOP to specify a region relative to the desktop. |
nX | X coordinate of the left margin of the screen region. |
nY | Y coordinate of the top margin of the screen region. |
nWidth | Width of the region. |
nHeight | Height of the region |
nOptions |
Specify any combination of the following flags (optional):
|
nSeverity |
Optional: Severity of the error that is raised if the verification fails. Can be one of the following values:
|
sFont | Font that should be checked for on the system and in the provided configuration files (optional). This parameter does not affect the conversion; it enables rapid fault detection when using remote agents and moving projects to different hosts. If a specified font is not on the operating system, then it must be installed. If the provided configuration files do not contain the font, use the OCR configuration dialog (System Settings / Citrix) to adjust them. When this parameter is omitted font checking is not performed. |
nFontSize | The font size that should be checked for in the provided configuration files (optional). This parameter does not affect the conversion; it enables rapid fault detection when using remote agents and moving projects to different hosts. If the provided configuration files do not contain the font size, use the OCR configuration dialog (System Settings / Citrix) to adjust them. When this parameter is omitted, font-size checking is not performed. |
nFontFlags |
Specifies the font shape (bold, italic, or underlined) that should be checked for in the provided configuration files (optional). This parameter does not affect the conversion; it enables rapid fault detection when using remote agents and moving projects to different hosts. If the provided configuration files do not contain the specified font shapes, use the OCR configuration dialog (System Settings / Citrix) to adjust them. When this parameter is omitted, font-shape checking is not performed. Specify any combination of the following values:
|
transaction TMain begin CitrixInit(640, 480); // do not change the resolution CitrixConnect("lab1", "user", "password", "domain", COLOR_16bit); CitrixWaitForLogon(); CitrixVerifyText("Joe", DESKTOP, 73, 109, 74, 23, CITRIX_FLAG_IgnoreWhitespace, SEVERITY_WARNING,"Tahoma", 8); CitrixDisconnect(); end TMain;