CitrixVerifyTextFuzzy Function

Action

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).

Note: OCR operations are only possible in Normal Mode (see CitrixInit). This function will fail when used in Fast Mode.

CitrixVerifyTextFuzzy performs OCR more exactly than CitrixVerifyText but requires more resources.

Include file

CitrixAPI.bdh

Syntax

CitrixVerifyTextFuzzy( in sVerify    : string,
                       in nWindow    : number,
                       in nX         : number,
                       in nY         : number,
                       in nWidth     : number,
                       in nHeight    : number,
                       in sLanguage  : string,
                       in nOptions   : number optional,
                       in nSeverity  : number optional := SEVERITY_ERROR ): boolean;

Return value

  • true if successful

  • 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
sLanguage The language of the text to be verified. Possible language codes are chi_sim, dan, deu, eng, fin, fra, ita, jpn, nld, nor, pol, spa and swe.
nOptions

Specify any combination of the following flags (optional):

  • CITRIX_FLAG_Equal When this flag is set the verification succeeds if the comparison succeeds (default).

  • CITRIX_FLAG_NotEqual When this flag is set the verification succeeds if the comparison fails.

  • CITRIX_FLAG_CaseSensitive When this flag is set the string compare operation is case sensitive.

  • CITRIX_FLAG_IgnoreWhitespace When this flag is set all white spaces are ignored.

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)

Example

  transaction TMain
  begin
    CitrixInit(640, 480); // do not change the resolution
    CitrixConnect("lab1", "user", "password", "domain", COLOR_16bit);
    CitrixWaitForLogon();
    CitrixVerifyTextFuzzy("Joe", DESKTOP, 73, 109, 74, 23, CITRIX_FLAG_IgnoreWhitespace, SEVERITY_WARNING, "eng");
    CitrixDisconnect();
  end TMain;