check picture

Description

Check a bitmap area of the AUT’s current display against one or more stored baseline images. Result is Passed ifthe displayed image matches one of the baselines; otherwise Failed.

Arguments

Valid contexts

This action may be used within the following project items: test modules and user-defined actions.

Notes

Applicable Built-In Settings

The following settings are applicable to this action: case sensitive,verify picture, remove double quotes from cells, standard ASCII only, object wait, window wait, load invisible controls.

Example

In this example we create a test to verify that the correct car picture is displayed in the Car Rental application when we select a car from the program’s catalog. The action lines below launch the application, navigate to the View Cars window, and select the node for Chevrolet Monte Carlo from the tree view, which should result in the following display:

Our last step in the action lines is to verify that the correct picture is displayed:

Action Lines

Notes: 
We’ve omitted the positional arguments of left, top, width and height from the check picture action line, meaning that the active area of the picture check corresponds to the entire car image control.

Verifying the picture

Note that the check picture action line in the test assumes that we already have a picture check with a name of chevrolet in existence. In this case, we don’t – at least not yet. But as mentioned, when a check picture execution runs up against a nonexistent picture check, the result is a suppressed warning and creation of an unverified picture check. And since the built-in setting verify picture has been set to yes, the unverified picture check prompts a Picture Check – New Picture dialog box to appear upon completion of the test:

Based on the question displayed, “Is it a yellow chevrolet?”, the tester does one of the following:

As the picture is indeed correct, we would expect our tester to click Pass, which has the following effects:

Finally, clicking Submit completes the picture verification.

Notes: 

Subsequent check picture executions - matches and non-matches

After storage of the baseline picture (or, eventually, multiple baseline pictures) in the chevrolet picture check, we may continue to perform test runs. Subsequent executions of the check picture at line 30 perform a capture of the AUT image, then compare it with the picture check’s baseline(s). If the automation finds a match, the result is Passed, with no manual verification required.

If, on the other hand, the newly captured test image does not match the baseline, a new dialog box, Picture Check – Change Picture, appears upon test completion:

In this dialog box, we can again observe the test picture. We also have the option of either comparing it with the test question, or against the existing baseline picture (or pictures), which can be observed by clicking the Baseline subtab. Our options are now:

Tip: 
In the event that a test run results in multiple unverified picture checks, a separate Picture Check dialog box is available to resolve each one. From any one of the dialog boxes, you can use the following buttons to navigate between them.

Click the Save button to save your decision.

Notes: 
The option (Fail, Pass, this is the new baseline, Pass, but keep the original, or Pass, save as a baseline variation) selected in the dialog box is only stored in temporary memory, that is, other your team members will not see the changes in the repository, until you click the Submit button.

Finally, click the Submit button to complete the picture verification process.

Notes: 
The Close button discards the changes (if any) and then closes the dialog box.

Automation mode

It has been mentioned that test runs with picture checks may be run in either an automated or semi-automated mode. So far, we have looked at semi-automated test runs, in which manual intervention is required at the end of each run. In a production test environment, it is frequently necessary to run tests, often in series, without stopping for human input.

In a production test environment, it is frequently necessary to run serial tests under batch control, without stopping for human input. Under batch file control, however, each test module in a serial batch run is invoked as a separate test run session. The upshot is that, when in semi-automated mode, any single test module with unverified picture checks results in a requirement for human intervention when that test module completes its execution, regardless of whether it is part of a serial test run. To avoid this interruption, ensure that such batch runs are performed in automated mode, thus allowing you to determine if and when manual picture check verifications take place.

Tip: 
To set up test runs in automation mode, refer to the verify picture built-in setting.

Accessing the Picture Check dialog box

We have seen how the Picture Check dialog box is the means by which new images are designated as baselines. We have also seen that the Picture Check dialog box appears automatically at the end of a semi-automated test run, and does not appear at all after an automated test run.

The obvious question here is “What happens when a new image – a baseline candidate – is encountered during an automated run? Is there any way to tell the system to accept that image as a baseline after the fact?”. The answer is Yes.

Related concepts

check picture exists

check picture not exists

does picture exist

Image comparison techniques


Copyright © 2023 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1(800) 322-0333