Discussing Bitmap Checkpoint In-Depth UFT

Bitmap Checkpoint is used to validate whether a visible area of your application is displaying correctly by capturing the required area as bitmap before and post-execution of the Test. You can select the entire page of the application or an area of an application. It does a pixel by pixel comparison between actual and expected images. You can also define percentage tolerance for RGB Color variance and Pixel tolerance up to a certain extent that might vary from machine to machine.

You can add a checkpoint to the entire window/page of the application or you can select only the required portion of the application.

How does the Bitmap checkpoint work in UFT?

During the recording session when the Bitmap checkpoint is added UFT captures the bitmap of the application(or specified area of application) and stores it in the Bitmap Checkpoint. At runtime, UFT dynamically captures the bitmap of the application and compares it with the previously captured bitmap stored in the checkpoint. If both previously captured and currently captured bitmap is matched, UFT will report it as Pass else it will report it as Fail.

You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins are loaded.

Unique Features of Bitmap Checkpoint in UFT

  • You can specify areas of the object to ignore or include in the checkpoint. Suppose you are capturing an area of an application that shows the time that may cause the checkpoint to fail.you can instruct UFT to ignore it during the run session by excluding the area in which it is located from the comparison.
  • You can define tolerance settings in RGB color variance in the checkpoint to work it at across all machines because different machines might have different color settings.
  • If the Bitmap Checkpoint fails, UFT saves the runtime bitmap and displays it next to the expected bitmap in the run results. You can also view a bitmap that reflects the difference between the two bitmaps, to assist you in identifying the nature of the discrepancy.

How To Add Bitmap Checkpoint on Entire Object

To add a Bitmap Checkpoint select the Bitmap Checkpoint option from the checkpoint menu and click on the required object.
Select the required object from the Bitmap Checkpoint window and click on the OK button. The entire object bitmap will be captured and display in the Bitmap Checkpoint properties window.
Bitmap checkpoint UFT
Click on the OK button, The checkpoint will be added in the script.
Bitmap-checkpoint-UFT-4
You can view the checkpoint properties by doing a right-click on the highlighted area as shown in the above snapshot or by opening the object repository.
Bitmap-checkpoint-UFT-5
UFT has given three kinds of options to mark the area of the image that you only want to be included in the bitmap checkpoint as shown below surrounded in the red rectangle.
Bitmap-checkpoint-UFT-9
The vice-versa is also possible. If you want a bitmap checkpoint to ignore a certain area of the image you can mark the area to get ignored. For example, any kind of counter increasing in the image or the image shows the date or time as shown below.
Bitmap-checkpoint-UFT-12

Adding Tolerance to RGB color in Bitmap checkpoint

To add tolerance to handle color variance or pixel density variance in the bitmap checkpoint click on the Advanced Setting option on the right bottom window. The Advanced Settings window will be displayed. You can do the required settings here. For Pixel density, you can set the variance either in percentage or in terms of a number of pixels.
Bitmap-checkpoint-UFT-30

How To Check a selection within the runtime bitmap

You can select the “Locate selection within runtime bitmap” radio button option to instruct UFT to check whether the specified bitmap is found anywhere within the bitmap of the actual object in your application during the run session.
In the bitmap editor area (in the Properties grid area of the dialog box), select the area that you want to locate as shown in the below snapshot (By default, the whole bitmap is selected.)
Bitmap-checkpoint-UFT-510

How to Use Locate image within runtime bitmap (load image file)

If images are dynamic in nature and they keep on changing after a certain time duration or days at a fixed location, in such a scenario rather than adding a new bitmap checkpoint every time you can update the image of the bitmap and browse to a .bmp file containing the image to use for the checkpoint by choosing the third option “Locate image within runtime bitmap (load image file)“. This instructs UFT to check whether the specified image is found anywhere within the bitmap of the actual object in your application during the run session.
Bitmap-checkpoint-UFT-78755

Recommended Posts

Leave a Reply