In TestComplete 8, the Visualizer subsystem has been drastically enhanced. Now, TestComplete automatically captures screenshots
during test recording and playback and let you see what happens with your tested application when recording and running your automated tests.
TestComplete captures images for keyword-driven tests and test scripts. The images captured during test recording are displayed in the new Test Visualizer panel below the
Keyword Test editor or the Code Editor.
Each image (frame) in this panel corresponds to a test command that simulates user actions over the tested application: clicks on a mouse button, simulating a
keystroke, and other actions. The object that the test command works with is highlighted with a red rectangle on the image. Thus, the Visualizer images help you better understand
what actions the recorded script statements and keyword test operations perform.
The test editor marks the test commands, for each image, with the icon. Commands that do not have an image
don’t have icons.
When you select the operation marked with this icon in the test editor, the Test Visualizer panel automatically highlights the appropriate image. This feature also works in the
opposite direction, to view a command that relates to a certain picture, select this image in the Test Visualizer panel, TestComplete then jumps to the script line or keyword test
operation that corresponds to that image.
You can perform different actions with Visualizer images, for instance, you can view frames at a larger scale, copy a frame or part of it to the clipboard, save a frame or part of it to
a file, and various other actions.
Besides capturing images during recording, Test Visualizer also captures images during test execution. It captures images and posts both the “recorded” and “played back”
screenshots to the test log. The test log shows these images in the Picture panel:
The images captured during recording are displayed in the Expected Image section of the Picture panel; the Actual Image section contains
the “played back” images. The object that worked with the test operations is highlighted with a red rectangle on both images. You can compare the expected and actual images and
easily see if the application’s state and behavior differs from what you had during test recording. The toolbar of the Actual Image section contains two special buttons that simplify
image comparison. Using these buttons, you can synchronize the view of the images and highlight the differences:
By default, Test Visualizer captures images of the top-level windows in a tested application. However, you can change the captured objects to enlarge the captured area or shrink it
down using the Capture style setting. Note that if you use different capturing modes when recording and playing back a test, TestComplete will report that the “recorded”
and “played back” images differ.
Another important feature of Test Visualizer is: by using its images you can easily and quickly add new test commands to the keyword-driven test without running the tested
application. To insert the operation, right-click the desired image in the Test Visualizer panel and select Insert On-Screen Action from the context menu.
Then select the desired object from the Visualizer image and use the ensuing On-Screen Action wizard to specify the method to be called and its parameters.
Once you have clicked Finish in the wizard, the new operation will be inserted to the test after the operation corresponding to the selected Visualizer frame.
As you can see, the Visualizer images help you understand the recorded test actions and find the difference between the expected and actual behavior of the tested application.
However, they may consume a lot of hard disk space, especially if you run a lot of functional tests. So, when you are creating tests, you can use Test Visualizer, but after your tests are
ready, it is recommended to disable Test Visualizer during the test runs. If an error occurs, you can enable the Visualizer, run the test and use the captured images to find the cause of
the problem even faster than before.
To reduce the overall size of captured images, you can also use the new Store last … events option that allows you to limit the number of messages posted to the log
and, as a consequence, the number of images corresponding to these messages. For example, you can specify that only 50 of the last event messages should be posted before the
test stops. This will decrease the number of captured images, but leave just enough images to find the cause of an error if and when it occurs.
As you can see, Test Visualizer includes a number of features that simplify the creation of automated tests and analyzing automated test results. If you are interested in trying
TestComplete 8, be sure to apply for the Beta version.