Synchronizing the Test
In this exercise you will insert a synchronization point into the lesson4 test script. The synchronization point will capture a bitmap image of the "Insert Done" message in the status bar. Later on when you run the test, WinRunner will wait for the "Insert Done" message to appear before it attempts to click the Delete Order button.
1 Make sure that the lesson4 test window is active in WinRunner. Click the title bar of the lesson4 test window.
2 Place the cursor at the point where you want to synchronize the test. Add a blank line below the button_press ("Insert Order"); statement. Place the cursor at the beginning of the blank line.
3 Synchronize the test so that it waits for the "Insert Done" message to appear in the status bar. Choose Create > Synchronization Point > For Object/Window Bitmap or click the Synchronization Point for Object/Window Bitmap button on the User toolbar.
Use the pointer to click the message "Insert Done" in the Flight Reservation window. WinRunner automatically inserts an obj_wait_bitmap synchronization point into the test script. This statement instructs WinRunner to wait 1 second for the "Insert Done" message to appear in the status bar.
4 Manually change the 1 second wait in the script to a 10 second wait. The one-second wait that was inserted in the previous step isn’t long enough, so find the statement:
obj_wait_bitmap("Insert Done...", "Img1", 1);
and change the 1 at the end of the statement to a 10, to indicate a 10 second wait.
5 Save the test. Choose File > Save or click the Save button.
6 If you are working in the Global GUI Map File mode, save the new objects to the GUI map.
During this test you recorded an object in the Flight Reservation window (the Insert Done bitmap). You should save this object in your GUI map.
To save a new object from a window that already exists in your GUI map, choose
Tools > GUI Map Editor.
Choose View > GUI Files.
Note that the new object is displayed in the L0 GUI map file. Choose File > Save. The New Windows dialog prompts you to save the new window to the existing map file or to a new one. Click OK to add the new window to your GUI map.
Choose File > Exit to close the GUI Map Editor.
In this exercise you will insert a synchronization point into the lesson4 test script. The synchronization point will capture a bitmap image of the "Insert Done" message in the status bar. Later on when you run the test, WinRunner will wait for the "Insert Done" message to appear before it attempts to click the Delete Order button.
1 Make sure that the lesson4 test window is active in WinRunner. Click the title bar of the lesson4 test window.
2 Place the cursor at the point where you want to synchronize the test. Add a blank line below the button_press ("Insert Order"); statement. Place the cursor at the beginning of the blank line.
3 Synchronize the test so that it waits for the "Insert Done" message to appear in the status bar. Choose Create > Synchronization Point > For Object/Window Bitmap or click the Synchronization Point for Object/Window Bitmap button on the User toolbar.
Use the pointer to click the message "Insert Done" in the Flight Reservation window. WinRunner automatically inserts an obj_wait_bitmap synchronization point into the test script. This statement instructs WinRunner to wait 1 second for the "Insert Done" message to appear in the status bar.
4 Manually change the 1 second wait in the script to a 10 second wait. The one-second wait that was inserted in the previous step isn’t long enough, so find the statement:
obj_wait_bitmap("Insert Done...", "Img1", 1);
and change the 1 at the end of the statement to a 10, to indicate a 10 second wait.
5 Save the test. Choose File > Save or click the Save button.
6 If you are working in the Global GUI Map File mode, save the new objects to the GUI map.
During this test you recorded an object in the Flight Reservation window (the Insert Done bitmap). You should save this object in your GUI map.
To save a new object from a window that already exists in your GUI map, choose
Tools > GUI Map Editor.
Choose View > GUI Files.
Note that the new object is displayed in the L0 GUI map file. Choose File > Save. The New Windows dialog prompts you to save the new window to the existing map file or to a new one. Click OK to add the new window to your GUI map.
Choose File > Exit to close the GUI Map Editor.