Relevant for: GUI tests and components
When working with tests and scripted components, you can use the text and text area checkpoint or output value commands to verify or retrieve text in your objects.
In addition, when working with tests, keyword or scripted components, and function libraries, you can insert steps to capture the text from objects in your application using the .GetVisibleText, the .GetTextLocation test object methods, the TextUtil.GetText or TextUtil.GetTextLocation reserved object methods, or the .GetText (for Terminal Emulator objects).
UFT 15.0.1 or later (tech preview): Use descriptive programming to create TextObject test objects for specific texts in your application. You can then perform operations on these test objects, such as Click, Drag, Drop, Hover, and Type. For example, you can use TextObject test objects to support HTML5 Canvas. For details, see the Insight > TextObject Object topic in the UFT Object Model Reference for GUI Testing.
Note: Text recognition is not supported for objects in the Active Screen.
When you use one of these options, UFT identifies text in your application uses an OCR (optical character recognition) mechanism. When using this OCR engine, you can use one of the following text recognition engines:
- The Abbyy OCR (the default option)
- The Tesseract OCR engine
- The Google Cloud OCR engine
- The Baidu Cloud OCR engine
Note: Cloud OCR engines are supported only in UFT versions 15.0.1 or later.
Using a cloud OCR engine requires setting up an account with the relevant vendor and obtaining an access token or key used to connect to the cloud service.
When UFT uses the OCR mechanism, a number of factors can affect the text it retrieves. Depending on the characteristics of the text you want to retrieve, you can adjust several OCR configuration options to optimize the way the text is captured. You use the Text Recognition Pane (Options Dialog Box > GUI Testing Tab) to specify the preferred text recognition mechanism and OCR-specific settings.
Note: If UFT cannot connect to the cloud OCR service using the configured details, it uses Abbyy instead.
OCR's accuracy depends on font and image quality and uniformity. You should also note the following considerations for performing more effective text recognition:
|Fonts in your text||
(For the Abbyy and Tesseract OCR engines only)
|Colors and color contrast||
|Text within images||
|Dimension for text recognition||
|Tests created in UFT 15.0 or earlier||
In UFT 15.0.1, the Abbyy OCR engine was upgraded to a much newer version. As a result, you may see changes in the text recognition of tests created in earlier versions of UFT.
|OCR Engine consistency||Once you determine which OCR engine works best with your tests, we recommend using that engine consistently. Using different engines for different runs may produce different results.|