OCR Checkpoint Operation

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

Use the OCR Checkpoint operation to recognize the text contents of a UI element on your PC screen or mobile device screen and verify that it matches the expected string. To recognize the text contents, the operation uses optical character recognition.

When you add the operation to your test, TestComplete displays the Checkpoint wizard that assists you in configuring the operation. To edit parameters of an existing operation, double-click it in your keyword test.

If the recognized text matches the specified string, the operation posts a checkpoint passed message () to the test log. Otherwise, the operation posts an error message () to the test log.

Requirements

  • Your TestComplete version must be 12.60 or later.

  • You need an active license for the TestComplete Intelligent Quality add-on.

  • The Intelligent Quality add-on must be enabled in TestComplete.

    You can enable the add-on during TestComplete installation. If you did not enable the add-on during the installation, you can do this at any moment later via the File > Install Extensions dialog. To do that, select File > Install Extensions from the TestComplete main menu and enable the Intelligent Quality > Intelligent Quality Core plugin in the resulting dialog.

  • Optical Character Recognition support must be enabled in TestComplete.

    By default, it is enabled automatically if you enable the Intelligent Quality add-on during TestComplete installation. If you experience issues with optical character recognition in your tests, select File > Install Extensions from the TestComplete main menu and make sure the Optical Character Recognition plugin is enabled (you can find it in the Intelligent Quality group). If the plugin is disabled, enable it. In the confirmation message that TestComplete shows when you enable the plugin, click the link to read a third-party license agreement. If you agree to the license terms, click Enable OCR.

    In addition, make sure that you do not have the legacy OCR plugin installed and enabled. You can find the plugin in the Common group.

  • Your computer must have access to the ocr.api.dev.smartbear.com web service. If you have firewalls or proxies running in your network, they should allow your computer to access the web service.

  • Your firewall must allow traffic through port 443.

Operation Result

The operation does not return any value.

Scripting Analogue

The operation is an analogue of the OCR.Recognize.CheckText method.

Child Operations

The operation cannot have child operations.

Operation Parameters

The operation has the following parameters:

SearchArea

The UI element whose text contents you want to verify.

Text

A string value against which the operation will verify the UI element’s text contents. Can contain the asterisk (*) or question mark (?) wildcards. The asterisk corresponds to a string of any length (including an empty string; the question mark corresponds to any single character (including none). It can be case-sensitive or case-insensitive depending on the Playback > Use case-sensitive parameters property of your project.

To edit operation parameters:

  1. Double-click the operation in your keyword test. TestComplete will call the Checkpoint wizard.

  2. Follow the wizard instructions to specify the operation parameters.

– or –

  1. Select the needed operation in your keyword test.

  2. Click the Value cell twice (not double-click) or select the cell and press F2. This will activate the in-place editor.

  3. Click the ellipsis button of the in-place editor. TestComplete will open the Operation Parameters dialog.

  4. In the dialog, specify the operation parameters. For detailed information on how to work with the dialog, see Specifying Operation Parameters.

  5. Click OK to close the dialog and apply changes.

  6. Press Enter to confirm the changes and close the in-place editor, or press Esc to close the editor discarding any changes.

Remarks

For information on how to use optical character recognition in tests, see Optical Character Recognition.

By default, if the OCR Checkpoint operation cannot find or access the UI element whose text contents it verifies, it waits for the UI element for a period that the Playback > Auto-wait timeout property of your project specifies. If the UI element has not been found by the end of the period, the operation fails.

The operation is available in the Checkpoints and AI categories.

See Also

AI Category
Optical Character Recognition
Checkpoints

Highlight search results