Text recognition in run-time
Relevant for: GUI tests and components
OpenText Functional Testing uses optical character recognition (OCR) mechanisms to identify text in your application.
When OpenText Functional Testing uses OCR
You can use OpenText Functional Testing's OCR capabilities in the following situations:
- 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).
- Text test objects, which represent specific texts in the application, are also identified using OCR.
Note: Text recognition is not supported for objects in the Active Screen.
To improve your test's performance, OpenText Functional Testing caches the texts retrieved from images by OCR engines within each test run.
Tip: You can change the OCR settings during a test run, for example, using SetABBYYParameters. If you need these changes to affect images whose texts was previously retrieved in the test run, you need to clear the OCR cache first. For details, see ClearOCRCache in Object Model Reference.
Text test objects
Create Text test objects to represent specific texts in your application, regardless of the technology used to develop the application. You can then perform operations on these test objects, such as Click, Drag, Drop, and Hover.
You can add Text test objects in the object repository editors and during a recording session. For details, see Work with Insight or Text test objects and Record a Text object step.
For the operations and properties supported on TextObjects, see the Insight & Text > TextObject Object topic in the Object Model Reference.
OCR mechanisms and settings
When the OCR mechanism is used, 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. Use the Configure text recognition settings to specify the preferred text recognition mechanism and OCR-specific settings.
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:
-
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.
- If OpenText Functional Testing cannot connect to the cloud OCR service using the configured details, it uses ABBYY instead.
-
To use the ABBYY OCR Engine for text recognition, you must include it when installing OpenText Functional Testing. If ABBYY is not installed, Tesseract is used as the default engine instead.
Optimize text recognition
OCR's accuracy depends on font and image quality and uniformity.
You should also note the following considerations for performing more effective text recognition:
| Parameters | Description |
|---|---|
| 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 |
OpenText Functional Testing now uses an ABBYY OCR engine that is newer than it used before. As a result, you may see changes in the text recognition of tests created in OpenText Functional Testing 15.0 or earlier. |
| OCR Engine consistency |
After 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. |
| Recognizing unusual text characters |
If you are using the ABBYY OCR engine, you can train it to identify unusual or unclear characters in your application. For details, see ABBYY OCR Pattern Training. |
See also:

