Software Testing Social Network

Free Software Testing Tutorial and Quality Assurance Portal

Home Featured Articles Testing Tools IBM Rational Rational Robot IBM Rational robot - Adding Features to GUI Scripts

IBM Rational robot - Adding Features to GUI Scripts

Article Index
IBM Rational robot - Adding Features to GUI Scripts
Page 2
All Pages

Adding Features to GUI Scripts

This article describes the features that you can add to GUI scripts. It includes the following topics:

Adding Features to GUI Scripts

This article describes the features that you can add to GUI scripts. It includes the following topics:

  •  Starting an application
  • Inserting a call to another script
  • Inserting verification points
  • Inserting timers
  • Inserting comments
  • Inserting log messages
  • Using the Insert menu
  •  Customizing SQABasic scripts

Starting an Application

While recording or editing a GUI script, you can start applications or other executable programs by using one of the Start buttons on the GUI Insert toolbar or one of the Start commands on the Insert menu.

Starting Applications

 

 

 

NOTE: To successfully test the objects in Oracle Forms, HTML, Java, Delphi,
C++, and Visual Basic 4.0 applications, enable the applications before you start
recording your scripts.

The following steps list the basic information you need to know to start an application:

1. Do one of the following:

    – If recording, click the Display GUI Insert Toolbar button on the GUI

       Record toolbar.

    – If editing, position the pointer in the script and click the Display GUI                       

       Insert  Toolbar   button on the Standard toolbar.

2. Do one of the following:

    – To start most applications, click the Start Application button. You can specify that you want the application to start under Rational Purify,

      Quantify, or PureCoverage during playback. (For more information, see  the next section,  Starting Applications Under the Rational Diagnostic Tools.)

    – To start a Java application that you want to start under Quantify or    PureCoverage during playback, click the Start Java Application button.

      (  For more information, see the next section, Starting Applications Under the Rational Diagnostic Tools. )

   – To start an HTML application, click the Start Browser button. If you are  creating a script to be used on cross-browser testing, record the script in Netscape and play back in Internet Explorer. (For more information, see using the Start Browser Toolbar Button on page 14-4 )

 3. Fill in the dialog box and click OK.

For information about an item in the dialog box, click the question mark in the upper-right corner and then click the item.

4. Continue recording or editing the script.

During playback, Rational Robot starts the specified application when it reaches that command in the script.

Starting Applications Under the Rational Diagnostic Tools

When you play back a Robot script, you can have any applications specified in the script start under the following Rational diagnostic tools:

Rational Purify – Detects and diagnoses memory access errors and memory leaks. Robot with playback under Purify works with Visual C/C++ applications on Windows NT 4.0 and Windows 2000.

Rational Quantify – Profiles the time spent in each module, function, line, and block of code, and detects performance bottlenecks within an application. Robot with playback under Quantify works with Visual C/C++, Visual Basic, and Java applications on Windows NT 4.0 and Windows 2000.

Rational PureCoverage – A code coverage analyzer that reports which modules, functions, and lines of code were and were not executed in any run or collection of  runs. Robot with playback under PureCoverage works with Visual C/C++, Visual Basic, and Java applications on Windows NT 4.0 and Windows 2000.

There are two ways to specify the diagnostic tool that an application should start under:

·         During recording, in the Start Application or Start Java Application dialog box

·         During playback, in the Diagnostic Tools tab of the GUI Playback  Options dialog box                

 

Specifying the Diagnostic Tool During Recording

During recording, you start an application using the Start Application or Start Java  Application dialog box. In the dialog box, you can specify the diagnostic tool that the application should start under during playback.

 

 

It is useful to set the diagnostic tool option during recording if you have several applications in a script and you want to start each application under a different tool during playback.

For example, suppose you have a shell script that calls three scripts. Each script starts one application, and you want to start each one under a different tool. When you started each application during recording, you would select the appropriate tool. When you played back the script, the setting for each application would override the setting in the GUI Playback Options dialog box.

The tools options are enabled in the dialog box if the tools are installed.

When you are ready to play back the script, you need to set some options in the GUI Playback Options dialog box. Specifying the Diagnostic Tool During Playback

 During playback, you can use the Diagnostic Tools tab of the GUI Playback Options dialog box to specify the diagnostic tool that all applications in a script should start under.   

 

 

 It is useful to set the diagnostic tool option during playback if you want all applications in a script to start under the same tool. This is especially useful if you want to run all the applications under a different tool each time you play back the script.

For example, suppose you have a shell script that calls three scripts. Each script starts one application, and you want to start them all under Purify. When you started each application during recording, you would select Using settings from GUI Playback Options dialog box. When you played back the script, you would select Rational Purify in the GUI Playback Options dialog box.

The tools options are enabled in the dialog box if the tools are installed.

Robot uses Set timeout multiplier value to multiply wait state and delay values during playback.   

 

Inserting a Call to Another Script

While recording or editing a GUI script, you can insert a call to a previously recorded GUI script. This lets you avoid repetitive actions in the application-under-test by taking advantage of scripts that already exist.

To insert a call to a previously recorded script while recording or editing:

1. Do one of the following:

– If recording, click the Display GUI Insert Toolbar button on the GUI

Record toolbar.

– If editing, position the pointer in the script and click the Display GUI Insert Toolbar  button on the Standard toolbar.

2. Click the Call Script  button on the GUI Insert toolbar.

 

 

 

 3. Select a GUI script from the list.

4. Do one of the following:

– Select Run Now if the script being recorded depends on the state in which the called script leaves the application-under-test. If this check box is selected, Robot adds the script call to the recording script and immediately plays back the called script when you click OK.

–Clear Run Now if the called script starts and ends at the same point in the  application-under-test, so that the script being recorded does not depend on the called script. If this check box is cleared, Robot adds the script call to the recording script but does not play back the called script when you click OK.

5. Click OK to continue recording or editing.

You can also group your scripts into a shell script.   

Inserting Verification Points

A verification point is a point in a script that you create to confirm the state of an object across builds. During recording, the verification point captures object information and stores it as the baseline. During playback, the verification point recaptures the object information and compares it with the baseline

NOTE: This section gives an overview of how to insert a verification point. For detailed information about verification points, see Chapter 4, Creating Verification Points in GUI Scripts.

 

To insert a verification point while recording or editing a script:

1. Do one of the following:

– If recording, click the Display GUI Insert Toolbar button on the GUI Record toolbar.

– If editing, position the pointer in the script and click the Display GUI Insert Toolbar button on the Standard toolbar.

2. Click a verification point button on the GUI Insert toolbar.

 

 

 

NOTE: To insert a File Comparison, File Existence, or Module Existenceverification point, open the Robot window (click the Open Robot Window button on the GUI Record toolbar). Click Insert > Verification Point and the appropriate menu command.

3. In the Verification Point Name dialog box, edit the name of the verification point as appropriate.

Robot automatically names the verification point with the verification point type and adds a number if there is more than one of the same type in the script

 

 

 

 

4. Optionally, set the Wait state options.

The wait state specifies how often Robot should retry the verification point until it passes or times out, and how long Robot should keep trying the verification point before it times out. (For more information, see Setting a Wait State for a Verification Point on page 4-8.)

5. Optionally, set the Expected result option.

When you create a verification point, the expected result is usually that the verification point will pass — for example, that a window does exist during playback. However, you can also indicate that you expect the verification point to fail — for example, that a window does not exist during playback.

6. Click OK.

 

Inserting Timers

Robot lets you insert start timer and stop timer commands to record and write to the log the duration of events in a script. A timer measures the time it takes to perform an activity. For example, you may want to record the time required to perform a database transaction on a remote server or how long it takes the same verification point to execute on client machines with different hardware configurations.

 

You can insert any number of timers with different names into the same script to measure a variety of separate tasks. You can nest timers within other timers (starting and stopping the second timer before stopping the first timer), and you can overlap timers (stopping the second timer after stopping the first timer). However, you should stop a timer before starting that same timer over again. If you start the same timer twice without stopping it, Robot terminates the first occurrence when it starts

the second.If you do not explicitly stop a timer, the timer is stopped automatically at the end of the transaction.When you play back a script that includes timers, you can view the elapsed time in the log. continues in page 2


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