Editing Image Parameters

Applies to TestComplete 15.70, last modified on December 17, 2024

You use the Edit Image Parameters page of the Add Image to Image Repository wizard to select the recognition area on the image you add to the repository and set its recognition parameters.

To open the page:

When adding a single image file to the Image Repository:

The wizard will show the page for the added image automatically.

When adding multiple image files to the Image Repository:

  1. The wizard will show the list of images you are adding.

  2. Select the needed image and click Edit.

In the dialog, you can edit the following parameters:

Recognition Area

The Recognition Area determines the image region that TestComplete will use for image-based recognition of the control during the test run. When in your test you address the image, TestComplete will search for the selected recognition area on the screen.

The red frame on the image highlights the recognition area. Adjust the frame borders to select the needed image area:

Image-Based Testing: Selecting a recognition area on the image added from a file

Click the image to enlarge it.

Use the zoom slider or the Zoom In and Zoom Out commands on the toolbar to adjust the image scale.

Use to set the image scale to 100 %. Use to set the image scale so that it fits the panel borders. Use to zoom in the selected recognition area.

Item Parameters

This section is available in the following cases —

  • If you add multiple image files as individual items to the Items list of the repository.

  • If you add a single image to the Items list of the repository.

You can specify the following parameters:

  • Item name - Specifies the name of the new Image Repository item. The default name generated by TestComplete is based on the name of the image file.

    You will use the name to address the element from tests, so it must be a valid script identifier. The scripting languages supported by TestComplete have different naming rules. To specify a name that can be used in any language, start the name with a letter and enter only letters, digits and underscore characters.

  • Composite control - Specifies whether the item is a composite or a simple control.

    This property is relevant only to recording image-based tests in Android applications. To learn more, see Recording User Actions Over Composite Controls.

Image Parameters
  • Image description - A free-form description of the image. For example, you can specify the tested application’s state when the image was captured.

  • Screenshot resolution - Specifies the screenshot resolution represented by the chosen image file.

Recognition Parameters

To find an image on a screen, TestComplete performs a pixel-by-pixel comparison of the image and screen regions. The recognition parameters affect the comparison:

  • Color tolerance - Specifies an acceptable color difference at which TestComplete treats two pixels as identical. The color difference is represented as an integer value within the range 0…255 that specifies an acceptable difference for each color component (red, green and blue) of the compared pixels. TestComplete considers two pixels identical if the difference in each color component does not exceed the specified value.

    If Color tolerance is 0 (the default value), TestComplete considers compared pixels identical only if they have the same color. When Color tolerance is 255, TestComplete considers pixels of any color identical.

  • Pixel tolerance - Specifies the allowed number of dissimilar pixels. If the number of such pixels is less than or equal to Pixel tolerance, TestComplete considers the images to be identical. The default value is 0. This means that all the pixels must coincide.

If you add a single image, click Finish to add the image to the Image Repository and close the wizard.

If you add multiple images, click OK to apply the specified parameters and return to the image list.

See Also

Adding Images to Image Repository From Files
Image-Based Testing
Image Set Item Properties

Highlight search results