Controlling Image Variations

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

The control appearance in a tested application can depend on various factors like a color scheme, application UI style, screen resolution, and so on.

Several approaches may help you deal with image variations of tested controls:

Extending an Image Set of a Control

Applicable to: All cases.

This is the most reliable mechanism. To increase chances of finding the needed control, you can add all possible variants of the control’s appearance to the Image Strip collection in the Image Set editor. See the "Adding Images to the Image Strip" section in the Working With Image Set Editor topic for detailed instructions.

Image-Based Testing: Extending a set of a control’s Images
Extending a set of a control’s Images

TestComplete will search for the first representation, then for the second one, and so on, until it finds the matching item or no more items are left.

Image-Based Testing: TestComplete recognizes the control because it is in the Image Set collection.
TestComplete recognizes the control because it is in the Image Set collection.

Adjusting Color Tolerance

Applicable to: Diminish slight differences in color of a control or of its background.

When the desired control looks similar to the baseline copy, but differs in color, you can adjust the Color tolerance recognition parameter in the Image Set editor.

Image-Based Testing: TestComplete recognized the control, because the Color Tolerance parameter has an appropriate value.
TestComplete recognized the control, because the Color Tolerance parameter has an appropriate value.

Adjusting Pixel Tolerance

Applicable to: Diminish slight differences in a control’s image.

When the needed control slightly differs from the baseline copy (for example, it has the text input cursor, punctuation characters, overlay icons and so on), you can adjust the Pixel tolerance recognition parameter.

Image-Based Testing: TestComplete recognized the control, because the Pixel Tolerance parameter has an appropriate value.
TestComplete recognized the control, because the Pixel Tolerance parameter has an appropriate value.

See Also

Image-Based Testing
How Image Comparison Works

Highlight search results