Handling Differences in Display Drivers - WinRunner

A bitmap checkpoint on identical bitmaps could fail if different display drivers are used when you create the checkpoint and when you run the test, because different display drivers may draw the same bitmap using slightly different color definitions. For example, white can be displayed as RGB (255,255,255) with one display driver and as RGB (231,231,231) with another.

You can configure WinRunner to treat such colors as equal by setting the maximum percentage color difference that WinRunner ignores.

To set the ignorable color difference level:

  1. Open wrun.ini from the <WinRunner installation folder>\dat folder.
  2. Adding the XR_COLOR_DIFF_PRCNT= parameter to the [WrCfg] section.
  3. Enter the value indicating the maximum percentage difference to ignore.

In the example described above the difference between each RGB component (255:231) is about 9.4%, so setting the XR_COLOR_DIFF_PRCNT parameter to 10 forces WinRunner to treat the bitmaps as equal:

[WrCfg] XR_COLOR_DIFF_PRCNT=10

Setting Bitmap Checkpoint and Capture Options

You can instruct WinRunner to send an e-mail to selected recipients each time a bitmap checkpoint fails and you can instruct WinRunner to capture a bitmap of your window or screen when any checkpoint fails. You set these options in the General Options dialog box.

You can also insert a statement in your script that instructs WinRunner to capture a bitmap of your window or screen based at a specific point in your test run.

To instruct WinRunner to send an e-mail message when a bitmap checkpoint fails:

  1. Choose Tools > General Options. The General Options dialog box opens.
  2. Click the Notifications category in the options pane. The notification options are displayed.
  3. Select Bitmap checkpoint failure.
  4. Click the Notifications > E-mail category in the options pane. The e-mail options are displayed.
  5. Select the Active E-mail service option and set the relevant server and sender information.
  6. Click the Notifications > Recipient category in the options pane. The e-mail recipient options are displayed.
  7. Add, remove, or modify recipient details as necessary to set the recipients to whom you want to send an e-mail message when a bitmap checkpoint fails. The e-mail contains summary details about the test and the bitmap checkpoint, and gives the file names for the expected, actual, and difference images.

To instruct WinRunner to capture a bitmap when a checkpoint fails:

  1. Choose Tools > General Options. The General Options dialog box opens.
  2. Click the Run > Settings category in the options pane. The run settings options are displayed.
  3. Select Capture bitmap on verification failure.
  4. Select Window, Desktop, or Desktop area to indicate what you want to capture when checkpoints fail.
  5. If you select Desktop area, specify the coordinates of the area of the desktop that you want to capture.

When you run your test, the captured bitmaps are saved in your test results folder.

To capture a bitmap during the test run:

Enter a win_capture_bitmap or desktop_capture_bitmap statement. Use the following syntax:

win_capture_bitmap(image_name [, window, x, y, width, height]);

or

desktop_capture_bitmap (image_name [, x, y, width, height]);

Enter only the desired image name in the statement. Do not include a folder path or extension. The bitmap is automatically stored with a .bmp extension in a subfolder of the test results folder.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

WinRunner Topics