Using Data-Driven Checkpoints and Bitmap Synchronization Points - WinRunner

When you create a data-driven test, you parameterize fixed values in TSL statements. However, GUI and bitmap checkpoints and bitmap synchronization points do not contain fixed values. Instead, thesestatements contain the following:

  • A GUI checkpoint statement (obj_check_gui or win_check_gui) contains references to a checklist stored in the test’s chklist folder and expected results stored in the test’s exp folder.
  • A bitmap checkpoint statement (obj_check_bitmap or win_check_bitmap) or a bitmap synchronization point statement (obj_wait_bitmap or win_wait_bitmap) contains a reference to a bitmap stored in the test’s exp folder.

In order to parameterize GUI and bitmap checkpoints and bitmap synchronization points statements, you insert dummy values into the data table for each expected results reference. First you create separate columns for each checkpoint or bitmap synchronization point. Then you enter dummy values in the columns to represent captured expected results. Each dummy value should have a unique name (for example, gui_exp1, gui_exp2, etc.). When you run the test in Update mode, WinRunner captures expected results during each iteration of the test (i.e. for each row in the data table) and saves all the results in the test’s exp folder.

  • For a GUI checkpoint statement, WinRunner captures the expected values of the object properties.
  • For a bitmap checkpoint statement or a bitmap synchronization point statement, WinRunner captures a bitmap.

To create a data-driven checkpoint or bitmap synchronization point:

  1. Create the initial test by recording or programming.
  2. In the example below, the recorded test opens the Search dialog box in the Notepad application, searches for a text and checks that the appropriate message appears. Note that a GUI checkpoint, a bitmap checkpoint, and a synchronization point are all used in the example.

  3. Use the DataDriver wizard (Table > Data Driver Wizard) to turn your script into a data-driven test and parameterize the data values in the statements in the test script. For additional information, see “Creating a Data-Driven Test with the DataDriver Wizard,”. Alternatively, you can make these changes to the test script manually. For additional information, see “Creating a Data-Driven Test Manually,”.
  4. In the example below, the data-driven test searches for several different strings. WinRunner reads all these strings from the data table.

    # The GUI checkpoint statement is not yet parameterized.
    obj_check_gui("message", "list1.ckl", "gui1", 1);
    # The bitmap checkpoint statement is not yet parameterized.
    win_check_bitmap("Notepad", "img1", 5, 30, 23, 126, 45); # The synchronization point statement is not yet parameterized.
    obj_wait_bitmap("message", "img2", 13);
    set_window ("Notepad", 5);
    button_press ("OK");
    }
    ddt_close(table);
    set_window ("Find", 4);
    button_press ("Cancel");
    For example, the data table might look like this: To create a data-driven checkpoint or bitmap synchronization point
    Note that the GUI and bitmap checkpoints and the synchronization point in this data-driven test will fail on the 2nd and 3rd iteration of the test run. The checkpoints and the synchronization point would fail because the values for these points were captured using the "John" string, in the original recorded test. Therefore, they will not match the other strings taken from the data table.
  5. Create a column in the data table for each checkpoint or synchronization point to be parameterized. For each row in the column, enter dummy values. Each dummy value should be unique.
  6. For example, the data table in the previous step might now look like this:
    data table

  7. Choose Table > Parameterize Data to open the Assign Parameter dialog box. In the Existing Parameter box, change the expected values of each checkpoint and synchronization point to use the values from the data table.
  8. For example, the sample script will now look like this:

    # the GUI checkpoint statement is now parameterized.
    obj_check_gui("message", "list1.ckl",
    ddt_val(table, "GUI_Check1"), 1);
    # The bitmap checkpoint statement is now parameterized.
    win_check_bitmap("Notepad",
    ddt_val(table, "BMP_Check1"), 5, 30, 23, 126, 45); # The synchronization point statement is now parameterized.
    obj_wait_bitmap("message",
    ddt_val(table, "Sync1"), 13);
    set_window ("Notepad", 5);
    button_press ("OK");
    }
    ddt_close(table);
    set_window ("Find", 4);
    button_press ("Cancel");
  9. Select Update in the run mode box to run your test in Update mode. Choose a Run command to run your test.

While the test runs in Update mode, WinRunner reads the names of the expected values from the data table. Since WinRunner cannot find the expected values for GUI checkpoints, bitmaps checkpoints, and bitmap synchronization points in the data table, it recaptures these values from your application and save them as expected results in the exp folder for your test. Expected values for GUI checkpoints are saved as expected results. Expected values for bitmap checkpoints and bitmap synchronization points are saved as bitmaps.

Once you have run your test in Update mode, all the expected values for all the sets of data in the data table are recaptured and saved.

Later you can run your test in Verify mode to check the behavior of your application.


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

WinRunner Topics