An OCR checkpoint is a test operation that recognizes text content of a UI element using optical character recognition and verifies that the recognized text matches the specified pattern.
This can be helpful when testing applications, the internal properties of which TestComplete cannot access, for example, if TestComplete does not support your application type or if the needed controls are graphical objects rendered on the screen.
In keyword tests, OCR checkpoints are performed using the OCR Checkpoint operation:
In scripts, OCR checkpoints are performed using the
During the test run, TestComplete:
Gets the UI element, the text content of which you want to verify.
Recognizes text contents of the UI element using optical character recognition.
Checks whether the recognized text matches the expected value and reports the results.
If the recognized text content matches the expected value, the checkpoint logs the checkpoint passed message; otherwise, it logs the error message. The Details panel of the test log shows the sought-for text and the actually recognized text.
If TestComplete can access internal properties of the needed UI element, use a property checkpoint to verify its text contents.
If your tested application implements accessibility information using the Microsoft Active Accessibility (MSAA) engine or the Microsoft UI Automation framework, you can configure TestComplete to use that accessibility information to get the content of the needed controls and use a property checkpoint to verify it.
(For Windows desktop applications only) If your tested application uses the
Direct2D library to render its text content on the screen, you can use Text Recognition to access the rendered text and the property checkpoints to verify it.
If TestComplete cannot recognize the text content of your tested object properly or to verify how your tested application’s user interface looks on the screen, you can use a region checkpoint.