Thursday, March 8, 2007

Recording in Analog Mode

Recording in Analog Mode
In this exercise you will test the process of sending a fax. You will start recording in Context Sensitive mode, switch to Analog mode in order to add a signature to the fax, and then switch back to Context Sensitive mode.

1 In the lesson3 test, place the cursor below the last line of the script. You will add the new test segment to the lesson3 test. If the test is not already open, choose File > Open and select the test. In the lesson3 test window, place the cursor below the last line of the test.

2 Start Recording in Context Sensitive mode. Choose Create > Record—Context Sensitive or click the Record button on the toolbar.

edit_set ("Edit", "3");

For more information about the different ways in which WinRunner records keyboard input, choose Help > TSL Online Reference.

3 Open the Fax Order form and fill in a fax number. In the Flight Reservation application, choose File > Fax Order. In the Fax Number box, type "4155551234".

4 Select the Send Signature with Order check box.

5 Sign the fax in Context Sensitive mode. Use the mouse to sign your name in the Agent Signature box.
Watch how WinRunner records your signature.

6 Clear the signature. Click the Clear Signature button.

7 Move the Fax Order window to a different position on your desktop. Before switching to Analog mode, reposition the window in which you are working.

8 Sign the fax again in Analog mode. Press F2 on your keyboard or click the Record button again to switch to Analog mode. Sign your name in the Agent Signature box. Watch how WinRunner records your signature.

9 Switch back to Context Sensitive mode and send the fax. Press F2 or click the Record button to switch back to Context Sensitive mode. Click Send. The application will simulate the process of sending the fax.

10 Stop Recording. Choose Create > Stop Recording or click the Stop button.

11 Save the test. Choose File > Save or click the Save button.

12 If you are working in the Global GUI Map File mode, save the new objects to the GUI map. When you ran the RapidTest Script wizard in the previous lesson, it learned all the windows and objects it was able to access. The fax order dialog box, however, can be open only when an order has already been opened, as you did in step 5 of Recording a Context Sensitive Test on page 38. Therefore, when you opened the fax order dialog box in step 3 above, WinRunner added the new window, and the objects you recorded within that window, to the temporary GUI map. The temporary GUI map is discarded whenever you close WinRunner, so it is important to save new windows and objects to the GUI map file that your test uses.

Choose Tools > GUI Map Editor. Choose View > GUI Files. Note that the Fax Order No. 3 window is displayed in the L0 GUI map file. Choose File > Save. The New Windows dialog box opens. Confirm that the flight1a.GUI file is displayed in the Loaded GUI Files box. Click OK. The Fax Order No. 3 window and all objects under that window are moved from the temporary GUI map to the flight1a.GUI map file. Choose File > Exit to close the GUI Map Editor.