Waiting for Bitmaps of Screen Areas - WinRunner

You can create a bitmap synchronization point that waits for a bitmap of a selected area in your application. You can define any rectangular area of the screen and capture it as a bitmap for a synchronization point.

You start by choosing Insert > Synchronization Point > For Screen Area Bitmap. As you pass the mouse pointer over your application, it becomes a crosshairs pointer, and a help window opens in the top left corner of your screen.

You use the crosshairs pointer to outline a rectangle around the area. The area can be any size: it can be part of a single window, or it can intersect several windows. WinRunner defines the rectangle using the coordinates of its upper left and lower right corners. These coordinates are relative to the upper left corner of the object or window in which the area is located. If the area intersects several objects in a window, the coordinates are relative to the window. If the selected area intersects several windows, or is part of a window with no title (a popup menu, for example), the coordinates are relative to the entire screen (the root window).

During a test run, WinRunner suspends test execution until the specified bitmap is displayed. It then compares the current bitmap with the expected bitmap. If the bitmaps match, then WinRunner continues the test.

In the event of a mismatch, WinRunner displays an error message, when the mismatch_break testing option is on. For information about the mismatch_break testing option, see “Setting Testing Options
from a Test Script.” You may also set this option using the corresponding Break when verification fails check box in the Run > Settings category of the General Options dialog box. For information about setting this testing option globally, see “Setting Global Testing Options.”

To define a bitmap synchronization point for an area of the screen:

  1. Choose Insert > Synchronization Point > For Screen Area Bitmap or click the Synchronization Point for Screen Area Bitmap button on the User toolbar. Alternatively, if you are recording in Analog mode, press the SYNCHRONIZE BITMAP OF SCREEN AREA softkey.
  2. The WinRunner window is minimized to an icon, the mouse pointer becomes a crosshairs pointer, and a help window opens in the top left corner of your screen.

  3. Mark the area to be captured: press the left mouse button and drag the mouse pointer until a rectangle encloses the area; then release the mouse button.
  4. Click the right mouse button to complete the operation. WinRunner captures the bitmap and generates a win_wait_bitmap or obj_wait_bitmap statement with the following syntax in your test script.
  5. win_wait_bitmap ( window, image, time, x, y, width, height );

    obj_wait_bitmap ( object, image, time, x, y, width, height );

    For example, suppose you are updating an order in the Flight Reservation application. You have to synchronize the continuation of the test with the appearance of a message verifying that the order was updated. You insert a synchronization point in order to wait for an “Update Done” message to appear in the status bar.

    WinRunner generates the following statement:

    obj_wait_bitmap ("Update Done...", "Img7”, 10);

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

WinRunner Topics