Tool Mentor: Creating an Automated Performance Test Script Using Rational Robot
This tool mentor describes how to use Rational Robot to record an automated performance test script for performance testing.
Tool: Rational Robot
Relationships
Related Elements
Main Description

Overview

For performance testing, scripts are often created by recording them in Robot. When you record a virtual user script, your interactions with the application under test cause protocol-specific communication between the client and the server. Robot records this communication and abstracts it into VU language test scripts after session recording is complete.

A performance test suite in TestManager then executes multiple instances of this script to apply a load to the system under test.

This tool mentor applies to Windows 98/ME/XP/2000 and NT 4.0 platforms.

Tool Steps

To record a virtual user script using Robot:   

  1. Start recording the virtual user script
  2. Insert timers, blocks, comments, and synchronization points
  3. Split script or end session recording
  4. Edit the virtual user test script if necessary

1. Start recording the virtual user script

When you record a virtual user script, your interactions with the application under test cause protocol-specific communication between the client and the server. Robot records this communication and uses it for script generation after you end the recording session.

  1. Prepare the test environment by setting the virtual user record options. See "Setting Recording Options" in the manual Rational Robot User's Guide.
  2. Click the Record VU Script button on the Robot toolbar. 
  3. Type a session name (40 characters maximum).
  4. Click OK to start recording.
  5. Robot is then minimized (default behavior), and the floating Session Record toolbar appears. Use this toolbar to stop recording or split scripts and redisplay Robot. Use the Session Insert toolbar to insert features like timers, blocks, comments, or synchronization points into a script. It can also be used to start an application. 
  6. In the Start Application Dialog box, specify the executable to launch. This executable should be the executable of your client application. For Web applications, use the browser to access the Web site.
  7. Click OK to start the client application.
  8. Begin interacting with the application under test as specified by your test case. Protocol traffic between the client and server is recorded.

2. Insert timers, blocks, comments, and synchronization points

You may insert timers, blocks, comments or synchronization points while recording a virtual user session. Click the Display Session Insert toolbar button on the Session Record toolbar, and then click one of these buttons:

  • Start Timer: The Start Timer dialog box appears and prompts you for the name of the timer you want to start. Enter a name and click OK or use the Cancel button to exit the dialog box.
  • Stop Timer: The Stop Timer dialog box appears and prompts you for the name of the timer you want to stop. Enter a name and click OK or use the Cancel button to exit the dialog box. 

A timer is a "bracket" around a set of client-server interactions. After execution of a performance test suite in TestManager, the times required for the executions of each timer are shown in the Performance and Response reports.

  • Comment: The Comment dialog box appears and prompts you for the comment you want to add to the script. Enter a comment and click OK or use the Cancel button to exit the dialog box. Comments are text within a script. They aid script readers in understanding the script but have no effect on the execution of the script.
  • Sync Point: The Comment dialog box appears and prompts you for the name of the synchronization point you want to add to the script. Enter a name and click OK or use the Cancel button to exit the dialog box. A synchronization point is a script feature that, during script execution, allows for coordination of actions among multiple virtual testers.
  • Start Block: The Start Block dialog box appears and prompts you for the block you want to start in the script. Enter a name and click OK or use the Cancel button to exit the dialog box.
  • Stop Block: The Stop Block dialog box appears and shows the name of the current block. 
    Click OK or use the Cancel button to exit the dialog box.

Like a timer, a block is a bracket around a set of client-server interactions. Unlike a timer, initial user think time is not included in a block. Additionally, all command identifiers within a block are prefixed with the block name (whereas in a timer, all command identifiers are prefixed with the name of the script).

Help icon   Refer to the following topics in the Robot online Help: 

  • Creating a new Suite
  • Inserting Comments into a Script
  • Inserting a Block into a Script
  • Inserting a Timer During Virtual User Recording
  • Inserting a Synchronization Point During Recording
(All dialog boxes for inserting a feature into a virtual user script contain a Help button to start Robot online Help.)

Help icon   Refer to the topic titled Adding Features to Scripts in Rational Robot User's Guide

3. Split script or end session recording

After you have finished performing the test case or logical unit of user activity, you can split a script or end the session recording. 

Splitting a session signifies that everything you have recorded since the last session split (or beginning of the session) represents a logical unit, such as login to a database or the modification of a particular record; for example, updating a customer's information in a customer relationship management application.

  1. To split a script:
  • Click the Split Script button on the Session Recording toolbar. 

  • Type a virtual user script name (40 characters maximum) for the activity just recorded.

  1. To stop session recording:
  • Click the Stop Recording button on the Session Recording toolbar. 
  • Type a virtual user script name (40 characters maximum).
  • To change the recording options, click Options. When finished, click OK.
  • Depending on your previous settings for virtual user recordings, the generator either generates a script (Automatic Filtering) or prompts you to select the client server communications and protocol (Manual Filtering), which should be used for generating a virtual user script.

Help icon   Refer to the chapter titled Recording Sessions - Choosing the Protocols to Include in a Script in the Rational Robot User's Guide.

4. Edit the virtual user test script, if necessary

You can edit existing scripts by manually changing the text of a script, as follows:

  • Edit the text of a script (delete a line, move text, and so forth).
  • Add a new user action to an existing script (add a shared variable or functionality).
  • Add a new feature to an existing script (add timers, blocks, comments, and so on).

Help icon   Refer to the topic titled VU Language Reference in the Robot online Help.