| Article Index |
|---|
| IBM Rational Robot Recording Sessions |
| Page 2 |
| All Pages |
Recording Sessions
This chapter describes how to record sessions and generate scripts. The chapter includes the following topics:
-
Recording a session
-
Recording a single script in a session
-
Getting feedback during recording
-
Canceling scripts during recording
-
Choosing the protocols to include in a script
-
Playing back a script quickly
-
Working with sessions
-
Coding a script manually
-
Defining script properties
-
Managing scripts and sessions
-
Testing Corba Applications
Recording a Session
To produce scripts for performance testing, you record a session. After recording, Robot generates one or more scripts from the session.
A Robot recording session contains all of the client requests and server responses issued from the time you begin recording until the time you stop recording. For API, network, or proxy recording, Robot stores all of the requests and responses recordedduring the session in a session file (.wch). The session file is sometimes called the watch file. With custom recording, four session file types are supported: session files, or watch files (.wch), XML files (.xml), annotation files (.ids), and extension files (.ext).
What You Can Record in a Session
Robot gives you considerable recording flexibility. You can record:
Multiple transactions. For example, you can record a data entry transaction and a query transaction in the same recording session, one after the other.
Transactions against the same server or different servers. For example, you can record one transaction against one Web server, and then record another
transaction against a different Web server.
Different types of requests in the same session. For example, you can record Oracle, SQL Server, HTTP, DCOM, DBLIB, Jolt, ODBC, Socket, Sybase, and
TUXEDO requests in a session.
Session File Types Generated After Recording
With API, network, and proxy recording, Robot generates a session file.
Custom recording supports four session file types. The type of file generated depends on how the custom recorder is configured. The four file types are:
Session file (.wch) - the standard session file type generated after recording a session.
XML file (.xml) - any XML file type.
Annotation files (.ids) - files that contain annotations (comments, start/stop blocks, timers, synchronization points) inserted during recording.
Extension files (.ext) - a custom format session file for any type of file.
Where Files Are Stored
By default, session files are stored in the TMS_Scripts directory of your current project datastore. For example, if the current project is MyProject, the directory
hierarchy might look like this:
c:\MyProject\TestDatastore\DefaultTestScriptDatastore\TMS_Scripts
Session files (the API calls or network IP packets Robot captures during recording) are stored with a .wch extension in the TMS_Sessions directory. For example, if you
named your session Tst:
c:\MyProject\TestDatastore\DefaultTestScriptDatastore\TMS_Sessions\Tst.wch
Session files produced from custom recordings are also stored in the test datastore.
Restoring Robot During Recording
When you begin recording, Robot becomes minimized by default, allowing you unobstructed access to the client application.
At any time during recording, you can restore the Robot window without affecting the client/server traffic you are recording by using one of the methods listed below.
For example, you might want to restore the Robot window to insert features such as timers, blocks, and synchronization points through the Robot Insert menu rather
than through the floating toolbar.
When Robot is minimized during recording or is hidden behind other windows during recording, bring it to the foreground in one of the following ways:
-
Click the Open Robot Window button on the Session Record floating toolbar.
-
Click the Robot icon on the Windows taskbar.
-
Use the standard Windows ALT+TAB key combination.
Recording a Single Script in a Session
Use the following procedure to record a single script in a session:
1. In Robot, click the Record Session button.
Alternatively, click File > Record Session, or press CTRL+SHIFT+R.
2. Type the session name (40 characters maximum), or accept the default name. Specify the script name when you finish recording the script.
If you have not yet set your session recording options, do so now by clicking Options.
3. Click OK in the Record Session - Enter Session Name dialog box. The following events occur:
Robot is minimized (default behavior).
The Session Record floating toolbar appears (default behavior). You can use this toolbar to stop recording, redisplay Robot, split a script, and insert
features into a script. (See Using the Floating Toolbars on page 7-5.)
The Session Recorder icon appears on the taskbar. The icon blinks as Robot captures requests and responses.
4. If the Start Application dialog box is displayed, provide the following information, and then click OK:
-
The path of the executable file for the browser or database application.
Optionally, the working directory for any components (such as DLLs) that the client application needs at runtime.
Optionally, any arguments that you want to pass to the client application. The Start Application dialog box appears only if you are performing API
recording, or if you are performing network, proxy, or custom recording and selected Prompt for application name on start recording in the General tab
of the Session Record Options dialog box.
5. Perform the transactions that you want to record.
As the application sends requests to the server, notice the activity in the Session Recorder window. Progress bars and request statistics appear in the top of the
window.
If there is no activity in the Session Recorder window (or if the Session Recorder icon never blinks), there is a problem with the recording. Stop recording and try
to find the cause of the problem.
Optionally, insert features such as blocks and timers through the Session Insert floating toolbar or through the Robot Insert menu.
6. When you finish recording transactions, close the client application. With API recording, when you close the client, Robot asks whether you want to stop
recording. If so, click Yes, and either name the session or click to ignore the recorded information in the Generating Scripts dialog box.
7. Click the Stop Recording button on the Session Record floating toolbar.
NOTE: If a problem exists with the recording and nothing is captured, Robot displays a Session Recording Error box.
To optimize all of Robot's recording features and to expand your test capabilities, you can split sessions into multiple scripts. For information about splitting a
recording session into multiple scripts, see Splitting a Session into Multiple Scripts on page 7-17.
Stop Recording and Generating Scripts
To stop recording and generate scripts:
1. Click the Stop Recording button on the Session Record floating toolbar.
2.In the Name of the just-recorded script box, type or select a name for the script that you just finished recording or accept the default name.
Alternatively, to cancel the requests you made since you began recording, click Ignore just-recorded information. For more information, see Canceling Scripts
During Recording on page 7-10.
3. Click OK.
The Generating Scripts dialog box displays. This dialog box shows the progress of automatic script generation. When script generation ends, the message
Completed successfully appears in the status bar, and the OK button is enabled.
During script generation, you might see:
The Missing Password dialog box. For more information about this dialog box, see Providing a Missing Password on page 7-6.
The Manual Filtering dialog box. For information about this dialog box, see Choosing the Protocols to Include in a Script on page 7-11.
4. Click OK in the Generating Scripts dialog box. The script that you recorded appears in the Robot window.
Using the Floating Toolbars
When you begin to record a script, Robot displays a floating toolbar by default. The Session Record toolbar gives you access to activities you might want to perform
while Robot is hidden from view during recording.
If you click the button on the far right of the Session Record toolbar, you display the Session Insert toolbar. This toolbar lets you insert features into the script and start
another application during recording.
The following figure shows the Session Record toolbar and the Session Insert

The Session Record and Session Insert toolbars can be enabled for custom recording. For more information, refer to the Session Recording and Script Generation
Extensibility Reference.
If Problems Occur During Script Generation
If problems occur during script generation, the following message appears in the status bar of the Generating Scripts dialog box:
Completed with warnings and/or errors.
To see the list of errors, click Details. If the text of an error is truncated, do one of the following:
-
Double-click the text to see the entire message.
-
Press CTRL+C to copy the text to the Clipboard.
Providing a Missing Password
During recording, if you provide a user ID and password required to access the database, Robot attempts to detect this login information. If Robot detects this login
information, it writes the information to the Authentication Datapool. (During script playback, TestManager checks the Authentication Datapool whenever an
emulated user needs to provide a valid user ID and password when accessing the database.)
If Robot cannot detect a password that you provided during recording, and it cannot find a valid password for the associated user ID in the Authentication Datapool,
Robot prompts you to provide the password just before generating the scripts you recorded.
Robot prompts you to provide each password that it could not detect, one by one, in the Missing Password dialog box.

Providing a Password
To add a password for the user ID displayed in Login:
1. Type the password in Password, and type it again in Verify Password. An asterisk ( * ) represents each character that you type.
If no password is needed for this user ID, select No Password.
2. Click Enter.
Robot automatically closes the dialog box after you provide the password.
Skipping One or More Passwords
If you do not know a password for a particular user ID, click Skip. You will need to provide the password later (for example, by editing the Authentication Datapool).
If you prefer to provide passwords for all the user IDs at a later time, click Skip All. You may prefer to do this if there are many passwords to provide.
Getting Feedback During and After Recording
When you begin to record a session, the Session Recorder displays. You can use this window to monitor client activity during the recording session.
The Session Recorder tracks a variety of statistics about the client/server interaction, such as the number of bytes the client sends or receives in a call.
To gauge the rate at which client/server activity occurs, the Session Recorder displays its data at three-second intervals. Information in the Session Recorder window is
continuously updated as the client/server interaction progresses.
If you do not see activity in this window during recording, Robot is not capturing client/server traffic. Stop recording and try to determine the cause of the problem.
NOTE: The rates and statistics views are not available for custom recorders.
The Session Recorder During Recording
The following figure shows the Session Recorder window, as it might appear during
recording, and the type of information that it displays:

The activity that the window displays varies, depending on your recording method.
-
With API recording, the window displays the number of API calls and bytes sent from your computer.
-
With network recording, the window displays the number of IP packets and the bytes in these packets. However, the information may not be from your
computer only. For example, if you are recording the activities of any client, in the Client list, the Session Recorder window reports the activity of all clients on
the network, not just the activity of your computer.
-
With proxy recording, the window displays the number of IP packets and the bytes in these packets.
-
Only the annotations window displays with custom recording.
The Session Recorder Icon
During recording, the icon associated with the Session Recorder window is displayed on the taskbar. The icon blinks whenever Robot is capturing a request or
response. This icon serves as a visual cue that Robot is recording, even when the Session Recorder window is minimized.
Canceling Scripts During Recording
During session recording, you can cancel script generation. After you cancel them, the scripts are deleted.
This feature is useful if you make errors while recording a session or if you want to exclude nonessential or preliminary activity (such as logging in or navigating to the
Web site that you want to test). For example, if you split a script at the point where you want to send a query, you can ignore the logon password and other preliminary
requests you needed to make to get to the query's starting point.
Canceling a Script in a Single-Script Session
If you have not split the session into multiple scripts, you can cancel both the script and the session, and then stop recording as follows:
1. During recording, click the Stop button on the Session Record floating toolbar.
2. In the Stop Recording dialog box, click Ignore just-recorded information.
3. Click OK in the Stop Recording dialog box.
4. Click OK to delete the session.
Canceling the Current Script in a Multi-Script Session
When you record a session, click the Split Script button to create multiple scripts.
To cancel the current script, keep the other scripts that you recorded in this session and then continue recording:
1. During recording, click the Split Script button on the Session Record floating toolbar.
2. In the Split Script dialog box, click Ignore just-recorded information.
3. Click OK.
You can now begin recording a new script.
To cancel the current script, keep the other scripts that you recorded in this session, 0and then stop recording:
1. During recording, click the Stop button on the Session Record floating toolbar.
2. In the Stop Recording dialog box, click Ignore just-recorded information.
3. Click OK.
4. Click OK in the Generating Scripts dialog box (after Robot finishes generating
the script).
Canceling All Scripts in a Multi-script Session
To cancel all of the scripts in a session and stop recording:
1. During recording, click the Stop button on the Session Record floating toolbar.
2. Click OK in the Stop Recording dialog box.
3. Immediately click Cancel in the Generating Scripts dialog box.
You probably want to keep a script if you have planned a script in TestManager and defined properties for it. You can later record over the script and retain the properties
that you have defined.
For information about deleting scripts and sessions, see Deleting Scripts and Sessions on page 7-27.
Choosing the Protocols to Include in a Script
During network and proxy recording (and to a lesser extent, during API recording), Robot might capture requests for protocols that you do not want to include in a
script.
You can specify the protocols to be included in either of the following ways:
-
Automatically, by selecting Auto Filtering in the Generator Filtering tab of the Session Record Options dialog box.
-
Manually, by selecting Manual Filtering in the Generator Filtering tab. If you select this check box, Robot displays the Manual Filtering dialog box during
script generation, immediately after recording.
Automatically Filtering Protocols
If Auto Filtering is selected, Robot automatically filters protocols based on the protocols selected in the Generator Filtering tab. Robot lists the protocols that are
available for capture in the Available Protocols section. When you move protocols to the Selected Protocols section, they are included in your script.
Auto Filtering is the only filtering choice for API extensions and custom recorder filter adapters.
Manually Filtering Protocols
The Manual Filtering dialog box lists in a hierarchical tree the connections that Robot detected during the recording session. In this dialog box, a connection has
three parts:
-
The name or IP address of a client
-
The name or IP address of the server that communicated with the client during the connection The protocol of the captured requests and responses issued during the connection
-
Use this dialog box to select the protocols to include in the script. You select the protocols to include by adding and removing the connections listed in the dialog box.
Because you are selecting protocols within the context of a connection, select protocols in one or more of these ways:
-
The protocol used in all the connections to a particular server
-
The protocols used in all the connections from a particular client
-
A particular protocol name, regardless of the clients and servers that use it
NOTE: Manual Filtering is not available for API extensions and custom recorder filter adapters.
Controls in the Manual Filtering Dialog Box
The Manual Filtering dialog box has the following controls:

Example of Manually Filtering Protocols
The following figure shows the Manual Filtering dialog box:

Choosing the Protocols to Include in a Script
Continues in page 2
| < Prev | Next > |
|---|