Software Testing Social Network

Free Software Testing Tutorial and Quality Assurance Portal

Home Featured Articles Testing Tools IBM Rational Rational Robot IBM Rational Robot Playing Back GUI Scripts

IBM Rational Robot Playing Back GUI Scripts

Article Index
IBM Rational Robot Playing Back GUI Scripts
Page 2
Page 3
Page 4
Page 5
Page 6
All Pages

This article explains how to play back GUI scripts. It includes the following topics: Restoring the test environment before playback, Setting GUI playback options, Playing back a GUI script and Viewing results in the TestManager log .

Analyzing verification point results with the Comparators

Playback Phases

When you play back a script, Rational Robot repeats your recorded actions and automates the software testing process. With automation, you can test each new build of your application faster and more thoroughly than by testing it manually. This decreases testing time and increases both coverage and overall consistency. There are two general phases of script playback:

  • Test development phase

  • Regression testing phase

These phases are described in the following sections.

Test Development Phase

During the test development phase, you play back scripts to verify that they work as intended, using the same version of the application-under-test that you used to record. This validates the baseline of expected behavior for the application. The following table shows the general process for the test development phase.

 

 

 

Regression Testing Phase

During the regression testing phase, play back scripts to compare the latest build of the application-under-test to the baseline established during the test development phase. Regression testing reveals any differences that may have been introduced into the application since the last build. You can evaluate these differences to determine whether they are actual defects or deliberate changes.

The following table shows the general process for the regression testing phase.

Task

 

 

Restoring the Test Environment Before Playback

 

The state of the Windows environment as well as your application-under-test can affect script playback. If there are differences between the recorded environment and the playback environment, playback problems can occur.

Before playing back a script, be sure that your application-under-test is in the same state it was in when you recorded the script. Any applications and windows that were open, active, or displayed when you started recording the script should be open, active, or displayed when you start playback. In addition, be sure that any relevant network settings, active databases, and system memory are in the same state as when the script was recorded.

Setting GUI Playback Options

GUI playback options provide instructions to Robot about how to play back scripts. You can set these options either before you begin playback or early in the playback process.

To set GUI playback options:

  • Open the GUI Playback Options dialog box by doing one of the following:

Before you start playback, click Tools > GUI Playback Options.

Start playback by clicking the Playback Script button on the toolbar. the Playback dialog box, click Options.

 

 

Acknowledging the Results of Verification Point Playback

By selecting the Acknowledge results check box, you can have Robot display a results message box each time it plays back a verification point. For example, in the following figure, the message box indicates that the verification point named Object Properties failed during playback. You must click OK before playback continues. During the test development phase, this lets you interactively view the playback results of each verification point. Click OK to continue playback.

 

During the regression testing phase, you usually play back scripts in unattended mode. By clearing the Acknowledge results check box, you can prevent Robot from displaying this message box. After the script plays back, you can view the results of all verification points in the log.

To set this option:

1. Open the GUI Playback Options dialog box. (See Setting GUI Playback Options on page 9-4.)

2. In the Playback tab, do one of the following:

Select Acknowledge results to have Robot display a pass/fail result message box for each verification point. You must click OK before playback continues. Clear Acknowledge results so that Robot does not interactively display pass/fail results.

 

 

3. Click OK or change other options.

Setting Log Options for Playback

A log is a file that contains the record of events that occur while a script is playing back. A log includes the results of the script and of all verification points. You view logs in TestManager. (For more information, see the TestManager Help.) To set the log options:

1. Open the GUI Playback Options dialog box.
2. Click the Log tab.
3. To output the playback results to the log so you can view them, select Output playback results to log. If you clear this, you cannot to view the playback results in the log.

NOTE: You can also use the Log button on the standard toolbar to turn logging results on and off.

 

4. To have the log appear automatically after playback is complete, select View log after playback.

If you clear this, you can still view the log after playback by clicking Tools > Rational Test > TestManager and then opening the log.

 

5. To have Robot prompt you before it overwrites a log, select Prompt before overwrite log.

6. Click one of the following: Specify log information at playback - At playback, displays the Specify Log Information dialog box so that you can specify the build, log folder, and log. Use default loginformation - At playback, uses the same build and log folder that was used during the last playback. Uses the script name as the log name.

7. Click OK or change other options.

Setting Wait State and Delay Options

In most cases, it is important for the playback of a GUI script to be synchronized with the application-under-test so that Robot executes commands in the script only after the application is ready to receive them. Robot attempts to maintain this synchronization automatically for you, using several techniques. You can refine the synchronization by setting the following options in the GUI Playback Options dialog box: ¾

NOTE: If a script needs to wait before executing a particular command, insert a delay for that command only. If you are testing an application in which time estimates are not predictable, you can define a wait state for a verification point so that playback waits based on specific conditions rather than on absolute time.

Setting Wait State Options

During playback, Robot waits for windows (including dialog boxes) to appear before executing a user action or verification point command. You can specify how often Robot checks for the existence of a window and how long it waits before it times out. For example, suppose that Robot is playing back a script with the following lines:

This example specifies that Robot should start an application, find a window on the desktop named "Form1", find a pushbutton named "Command5", and generate a click on that button. However, suppose Robot gets to the SetContext line in the script and fails to find a window named "Form1". This may not necessarily be an error - the application may not yet have started up and created the window. In this case, Robot keeps looking for the window for a specified period of time.

By default, if Robot cannot find a window during playback, it waits for 2 seconds and then looks for it again. If it still cannot find the window after 30 seconds, it times out and returns a command failure indication to the script. Script execution continues or stops based on the On script command failure setting in the Error Recovery tab of the GUI Playback Options dialog box. You can change the default values for the retry time and the timeout by changing the wait state options.

To set the wait state options:

1. Open the GUI Playback Options dialog box.

2. Click the Wait State tab.

3. To specify how often Robot checks for the existence of a window, type a number in the etry test every box.

4. To specify how long Robot waits for a window before it times out, type a number in the Tmeout after box.

5. Click OK or change other options.

 

NOTE: This synchronization is used only in Object-Oriented Recording. In contrast, low-level scripts are processed in real time. They play back at the same speed at which they were recorded and do not use automatic wait settings.



  Attention! For US visitors deep discounted electronics products available! CLICK HERE to check it out.