Tips for Effective Client Emulation

Handling Random Popups and Dialogs

During script playback, some messages popup suddenly causing script execution to terminate.  For example, error messages, virus scans, etc. In order to ensure that script execution is not disturbed, these message popups need to be handled as Exceptions.

Typically, it would be difficult for a developer to determine what these messages are and when they popup. Under such circumstances, adopt the methodology described below to handle the popups:

  1. From the CitraTest script window, select Playback Options from the Playback menu. From the Playback Options dialog box that appears, select the Screen Event Handling tab (see Figure 1).

    Figure 1 : The Screen Event Handling tab

  2. Select the Capture Screen checkbox in Figure 1, click the Apply button therein, and finally, the ok button.
  3. Enabling screen capturing ensures that all messages that randomly popup during script execution are automatically captured by CitraTest. Every screen so captured by CitraTest will be named as PopupScreen1, PopupScreen2, . . . etc. By default, the screens will be stored in the Images directory associated with the project under consideration.
  4. The next step is to instruct CitraTest on how to handle the captured popups. For that, open the captured image using the CitraTest script window (see Figure 2).

    Figure 2 : Opening a captured popup

  5. In the example depicted by Figure 2, an automatically captured popup named PopupScreen1has been opened. PopupScreen1, in this example, is the image of a virus scan’s progress tracker. In order to ensure that the virus scan does not affect script execution, CitraTest has to minimize the progress tracker. To achieve this, the Minimize button of the tracker has to be set as the click spot of PopupScreen1. To do this, click on the button in the tool bar of Figure 2, and then click on in PopupScreen1.
  6. Then, save the PopupScreen1 image.
  7. Next, open the Screen Event Handling tab once again (see Figure 3). Use the Add>> button in Figure 3 to add PopupScreen1.bmp to the Image Names list. Then, select the added image, and click the Click on Hotspot check box in Figure 3. Finally, click the Apply button, and then the ok button to save the changes. 

    Figure 3 : Adding a captured image to the Image Names list

  8. Sometimes, you might be aware of the messages that may popup in the course of script execution. For example, if a virus scan is scheduled to take place at 1 PM daily, then you would be aware that the progress tracker will appear at 1 PM every day. This is sure to disrupt script execution. In such a case, you can manually capture the image of the progress tracker, and then proceed in the manner discussed below.
  9. Open the Screen Event Handling tab (as discussed before) and add the manually captured image to the Image Names list (see Figure 3).

    Figure 4 : Adding the progress tracker’s image to the Image Names list

  10. Next, select the Click on Hotspot check box in Figure 2.126. Finally, click on the Apply and ok buttons.