| Article Index |
|---|
| IBM Rational Robot Setting Recording Options |
| Page 2 |
| All Pages |
Setting Recording Options
This chapter describes how to choose recording methods, set recording options, and set script generation options. It includes the following topics:
● About session recording
● Setting the recording method
● Setting script generation options
● Setting general recording options
● Defining a client or server computer
● Removing a computer or port
● Authenticating logon information
● Managing proxies
About Session Recording
A Robot recording session contains all the client requests and server responses issued from the time you begin recording until the time you stop recording. Test scripts are generated from the recorded client requests and server responses. Robot stores the recorded requests and responses in a session file.
The following steps outline the general process for recording a session:
1. Set the session recording options.
Recording options tell Robot how to record and generate scripts. You set recording options to specify:
-
The type of recording you want to perform, such as API, network, proxy, or custom. The recording method you choose determines some of the other recording options you need to set.
-
Script generation options, such as specifying whether you want the script to include datapool commands or think-time delays, and whether you want to filter out protocols to control the content of the script.
General recording options, such as the prefixes to assign to default script and session names.
2. Start the recording session.
With the API recording method, you must start recording before starting the client application, at which point Robot prompts you for the name of the client.
With the other recording methods, you can start recording before or after you start the client.
3. Start the client application.
4. Record the transactions. During recording, you can split the session into multiple scripts, each representing a logical unit of work. Optionally, Insert timers, blocks, comments, and other features into the script during recording.
5. Close the client application.
6. Stop recording.
After recording, Robot automatically generates scripts.
Setting the Recording Method
A recording method defines the type of session recording. The choices are:
● API recording (the default)
● Network recording
● Proxy recording
● Custom recording
Set the recording method from the Method tab in the Session Recording Options dialog box. To access this tab:
1. Click Tools > Session Record Options.
2. Click the Method tab, and select the type of recording you want to perform.
The following figure illustrates the Method tab:
After you select a recording method, Robot disables tabs that do not apply to that method. This is because access to certain tabs is not relevant to the selected recording method and generator filtering protocol. For example, if you select Network recording, the Generator:Custom, Method:Proxy, and Method:Custom tabs are disabled because they do not apply.
In general, select API recording. However, the following table lists certain situations in which a recording method is required or recommended:
API Recording
With API recording, Robot records API calls between the specific client application and the server. Recording occurs on the client rather than on the wire, as with network and proxy recording. Therefore, choose API recording if you are accessing secure data from a Web server, because API recording captures the information before it reaches the wire and is encrypted.
API recording is supported only on Windows NT, Windows 2000, and Windows XP clients. You do not have to specify the network names or IP addresses of the client and server as you do with network and proxy recording.
With the API recording method, you must start recording before starting the client application, at which point Robot prompts you for the name of the client. With the
other recording methods, you can start recording before or after you start the client.
Disabling Script Debugging
When you perform API recording of Internet Explorer, disable script debugging to avoid abnormal browser behavior that may cause a session to record improperly.
To disable script debugging in Internet Explorer:
1. From Microsoft Internet Explorer, click Tools > Internet Options.
2. Click the Advanced tab.
3. Under Browsing settings, click Disable Script Debugging.
4. Click OK.
Choosing API Recording
To use the API recording method:
1. Click Tools > Session Record Options.
2. Click the Method tab, and then click API recorder.
API Recording Using API Recorder Adapters
Robot's extensible framework provides for API recording using API recorder adapters that you install and configure. An API recorder adapter is the interface between Robot's extensible framework and a recording component that captures traffic between a designated target and an application that you want to test. For this type of recording to work, and for the resulting script to play back, an API Recorder Adapter, a Generator Filter Adapter, and an API Script Generator Adapter must be properly installed and configured.
Upon startup, if Robot detects installed adapters, API recording and script generation are extended to include one or more protocols. These protocols are selected in the Generator Filter tab.
To use these adapters you must:
1. Install and configure each of the adapters.
2. Select API recorder in the Method tab.
3. In the Generator Filtering tab, select the protocol corresponding to the installed generator filter adapter from the Available protocols box and move it to the Selected protocols box. An installed generator filter adapter is an exclusive protocol that cannot be selected in combination with other protocols.
For more information, refer to the Session Recording and Script Generation Extensibility Reference.
Network Recording
With network recording, Robot records packet-level traffic at the OSI network interface layer using the "promiscuous" mode of your network card. Network recording is media-independent, supporting standards such as Ethernet, Token Ring, and Fiber Distributed Data Interface (FDDI).
Network recording occurs on the wire rather than on the client (as with API recording).
Choosing Network Recording
To use the network recording method:
1. Click Tools > Session Record Options.
2. Click the Method tab, and click Network recorder.
3. Click the Method:Network tab, and select the client/server pair that you will record. The default is to record all of the network traffic to and from your computer. (For information, see Selecting a Client/Server Pair below.)
4. Click the Generator Filtering tab to specify the network protocols to include in the script that Robot generates.
Selecting a Client/Server Pair
The Method:Network tab contains the following lists of computer addresses. Select one item in each list:
Client - The client's network name (or IP address) and, optionally, the port number.
Server - The server's network name (or IP address) and, optionally, the port number.
If a computer that you want to specify is not listed, define the computer.You can choose Any or Local machine instead of a specific computer name:
● If you select Any for either the client or the server, Robot records traffic for all clients or all servers on the network.
● If you select Local machine for the client (the default), Robot records traffic from the Local computer. Robot determines the computer's network name automatically. You do not have to specify it.
Local machine records traffic from all of the computer's ports. To record traffic from a particular port, click Manage Computers to define the computer network name and port number of interest.
Selecting a Network Card
If you are using network recording and the Local computer has more than one network interface card installed, you must identify the card to use as follows
(Windows NT 4.0 operating system):
1. Click Start > Settings > Control Panel.
2. Double-click the Network icon.
3. Click the Bindings tab.
4. In the Show Bindings for box, select all services.
5. In the list of services, expand the Rational Test Network Driver item by clicking the + icon before it.
6. Click the network interface card that you want to use.
7. Click Move Up until the selected card is at the top of the list.
8. Click OK.
9. Reboot the computer.
Instead of moving the name of the interface card that you want to use to the top of the list, click Disable to disable all of the other interface cards. Windows 2000 and Windows XP do not have binding requirements. If you have more than one network card installed in a Windows 2000 or Windows XP environment, you can create a new connection to the network card you want to use in Network and Dial-up Connections. For more information, refer to the
Windows 2000 or Windows XP Help.
Proxy Recording
With proxy recording, client/server traffic is routed through a proxy computer.
NOTE: This document uses the word "proxy" to refer to the computer that performs proxy recording. It does not refer to a Web proxy server.
Proxy recording occurs at the OSI application layer and involves receiving and sending socket transactions. With proxy recording, you can record conversations
between multiple, specific clients and servers (that is, when the Any choice in the Method:Network tab for either clients or servers would be impractical).
The following examples show when you might need multiple clients and servers:
● If different user groups (such as order entry clerks and customer service representatives) issue requests to the server at the same time during a single recording session
● If requests are being sent to different databases (such as an Inventory database and a Human Resources database) located on different computers
The proxy computer intercepts requests from clients and relays them to the server. None of the client computers issuing requests to the servers need to have Robot installed. Robot is required only on the proxy computer. The following figure illustrates a proxy recording setup with multiple client computers and one server.
Each computer's network name indicates its role in the client/server traffic. Network names are followed by the computer's port number:
NOTE: The proxy can run on one of the client computers. To have one computer serve as both the proxy and a client, assign different port numbers to the proxy and client.
When choosing proxy recording, you must:
● Identify and define the client/server pairs that communicate through the proxy.
● Create a proxy server.
● Specify network protocols to include in the script that Robot generates.
To set up and use proxy recording:
1. Start Robot on the proxy computer.
2. In the Proxy Administration dialog box, match up the proxy computer and port with each server to be used in the test.
For details, see Creating a Proxy Computer on page 6-11.
3. In the Method:Proxy tab of the Session Record Options dialog box, match up each client with the server it will send requests to. Be sure to specify the actual server and not the proxy computer.
For details, see Identifying Client/Server Pairs on page 11.
4. Configure each client to send requests to the proxy computer, not to the server. For example, if the client sends requests to an Oracle database, use the Oracle client configuration software to specify the proxy computer's address and port number, not the server's.
5. Start the client application and navigate to the point where recording begins.
6. On the proxy computer, enable recording (File > Record Session).
7. With recording enabled, each tester at each client computer performs the transactions to record.
8. When all transactions are complete, stop recording on the proxy computer.
Choosing Proxy Recording
To use the proxy recording method:
1. Click Tools > SessSession Record OptiOptions.
2. Click the Method tab, and then click PrProxy recorder
3. Click the Method:Proxy tab to: recorder.
● Create a proxy computer
● Identify client/server pairs that communicate through the proxy.
● After you set up your system for proxy recording, record a trial script to make sure the proxy recording yields the results you expect.
NOTE: If you perform proxy recording against an Oracle database, the server should not be set up to redirect. Consult your Oracle documentation for
information.
Creating a Proxy Computer
You create a proxy computer by mapping the proxy computer's address to the address of one or more servers.
Before you create a proxy computer, be sure that:
¾
¾
The server's network name (or IP address) and port number are defined. If they are not defined, click Manage Computers to display the Manage Computers
dialog box. For information about how to define the server's network name and port number in this dialog box, see Defining a Client or Server Computer on page
6-40.
Proxy service is running. For more information, see Starting and Stopping Proxy Service on page 6-45.
To create a proxy computer:
1. Click Tools > Session Record Options.
2. Click the Method tab and make sure that Proxy recorder is selected.
3. Click the Method:Proxy tab.
4. Click Proxy Admin.
5. In the Proxy:Port list, specify the proxy computer's port number. Note that
Robot has already detected and specified the proxy computer's name.
You can specify any available port number. Avoid the "well-known" ports (those below 1024). If you specify a port number that is unavailable, Robot prompts
you for a new port number.
6. In the Server:Port list, select a server involved in the test.
7. Click Create Proxy.
The proxy computer is added to the Existing Proxies list.
Identifying Client/Server Pairs
Clients and servers communicate through the proxy. A client and server that communicates through a proxy is called a client/server pair.
Before you identify a client/server pair, be sure that the network names or IP addresses of all the clients and servers in your test appear in the Method:Proxy tab. If none are listed, click Manage Computers to define them. For information about how to define a client or server computer, see Defining a Client or Server Computer on page 6-40.
To associate each client in your test with its matching server:
1. Click Tools > Session Record Options.
2. Click the Method tab and make sure that Proxy recorder is selected.
3. Click the Method:Proxy tab.
4. Select a client in the Client [:Port] list.
The client port is optional.
5. Select the client's server in the Server:Port list (the server port is a required entry).
6. Click Add.
The client/server pair that you have identified appears in the Client/Server pairs for recording list.
Custom Recording
Robot has an extensible framework that provides for the installation and configuration of custom recorder adapters and custom script generator adapters. For this type of recording to work, and for the resulting script to play back, a custom recorder adapter and custom script generator adapter must be installed and configured.
Robot provides this extensibility and stores recorded data in a Rational project, but custom recording is unrestricted; its capabilities are defined by the installed adapter. Because this type of recording is customized, it works independently of existing Robot recording and script generating capabilities.
To use custom recording:
1. Properly install and configure each of the adapters.
2. Select Use Custom in the Method tab.
If custom recorder adapters and custom script generator adapters are installed and configurable, the Method:Custom, General, Generator:Custom, and Generator tabs are enabled, and all other tabs are disabled.
Choosing Custom Recording
To use the custom recording method (after a custom recorder adapter has been installed):
1. Click Tools > Session Record Options.
2. Click the Method tab, and then click Use Custom.
3. In the Recorder list, select a custom recorder.
4. In the Script Generator list, select a custom script generator.
For more information, refer to the Session Recording and Script Generation Extensibility Reference.
Setting Script Generation Options
Although you should set script generation options before you record a session, you can also change these options after you record a session. After recording, you can regenerate the script with new options without recording the session again. The script generation options enable you to:
● Modify the contents of the script-for example, by specifying whether the script includes datapool commands or think-time delays.
● Set filtering options to control the size of the script-for example, by selecting certain protocols to be included and excluding the other protocols.
● Modify a script that contains specific protocol requests-for example, controlling settings for HTTP, Oracle, Tuxedo, or IIOP.
Modifying the Contents of a Script
To modify the contents of a script:
1. Click Tools > SessSession Record OptiOptions.
2. Click the Generator tab.
The following figure illustrates the Generator tab:
NOTE: Depending on the script generator configuration, some options on the Generator tab may not be enabled for custom script generator adapters.
The Generator tab allows you to specify and modify the contents of generated scripts.
The following sections describe these options.
Use Datapools
Select this check box if you want Robot to generate datapool commands in the script. Datapool commands allow the script to access data in a datapool.
A datapool allows each virtual tester running a script to send realistic data to the server. If you do not use a datapool, each virtual tester sends the same data to the
server (the data that you sent to the server when you recorded the script).
Command ID Prefix
This option specifies an optional prefix for emulation command IDs. Emulation commands include commands for emulating database clients as well as commands for performing communication and timing functions. An emulation
command ID appears in brackets after the command name. It uniquely identifies the emulation command in TestManager reports.
Emulation command IDs consist of a prefix and a three-digit numeric suffix.
For example, if you specify task as the command ID prefix, you might see the following emulation command name and ID:
sqlnrecv ["task001"] 1355;
Robot automatically increments the numeric suffix by a value of 1 with each emulation command.
The maximum length of the command ID prefix is seven characters. If you do not specify a prefix, Robot uses the script name as the prefix (up to seven characters).
You cannot use this option to define multiple command ID prefixes in a recording session. If you want your script to contain multiple command ID prefixes, use blocksto define these prefixes.
With TUXEDO commands, any prefix that you define in Command ID prefix is ignored if you specify a predefined TUXEDO emulation command ID prefix. For more information, see Assigning a Prefix to TUXEDO Command IDs on page 6-31.
Truncating a Command ID Prefix
Robot uses a tilde (~) to indicate that a command ID prefix that exceeds seven characters has been truncated.
The command ID prefix format is slightly different for truncated prefixes that appear in single-script sessions and multi-script sessions. For example, if you define a command ID prefix of EmulCmdID, Robot truncates the prefix as follows:
● Truncation format for single-script sessions:
sqlexec ["EmulCmd~024"] "select * from table";
sqlnrecv ["EmulCmd~025"] ALL-ROWS;
● Truncation format for multi-script sessions:
sqlexec ["EmulCmd~3.024"] "select * from table";
sqlnrecv ["EmulCmd~3.025"] ALL-ROWS;
The 3 after the tilde shows that the command is in the third script in the session.
Display Recorded Rows
This option specifies whether you want some or all of the data retrieved from the server to be inserted into the script. The inserted data is for informational purposes only. Data is inserted in the form of comments and does not affect playback.
Select one of the following values from the Display recorded rows list:
Display recorded rows is supported only for Sybase, SQL Server, ODBC, HTTP,
TUXEDO, and socket protocols.
Verify Playback Row Counts
This option specifies whether rows affected by a SQL statement or the number of bytes affected by a request to a Web server are inserted into the script.
This information helps you determine whether the statement or request executed during playback behaves as it did during recording. If a different number is returned
during playback, the Test Log window notes the discrepancy.
Verify playback row counts has the following meanings:
For an example of the effect that this check box has on a generated script, see Example of the Verify Playback Check Boxes on page 6-17.
NOTE: This option is not supported for VB scripts.
Verify Playback Return Codes
This option specifies whether you want the return code for SQL statements to be inserted into the script. During playback, TestManager checks whether the return code for SQL statements executed during playback matches the return code for the same statement executed during recording. If the SQL statement returns a different code during playback, the Test Log window notes the discrepancy.
The Verify playback return codes check box has the following meanings:
Example of the Verify Playback Check Boxes
Suppose you want the script to execute the following SQL statement:
INSERT INTO mytable VALUES ("value1", "value2")
Depending on your Verify playback row counts and Verify playback return codes selections, Robot generates the SQL statement in one of the following ways:
Because one SQL statement can return multiple error messages (for example, as a result of stored procedure execution), EXPECT_ERROR is an array. During playback, if an error code is returned that is not one of the values specified in the array, TestManager generates an error.
NOTE: This option is not supported for VB scripts.
Bind Output Parameters to VU Variables
Select this check box to automatically script the VU expressions needed to contain the return values of output parameters. This applies only to emulation commands that support output parameter binding (currently the iiop_invoke command). Clearing this box shortens VU scripts, but you have to manually script output parameter binding expressions and binding variable declarations for any output parameters of interest.
NOTE: This option is not supported for VB scripts.
Playback Pacing
Controls the script's playback speed by including or excluding think-time delays in the script. A think time delay includes both the time required for the user to think about and key in a request and the time required for the client to receive a response to the request.
Choose one of the following Playback Pacing settings:
Pacing settings of per command and per script use a combination of think-time and response-time environment variables. For more information, see the VU Language
Reference and the VB Language Reference.
NOTE: If you set Playback Pacing to none, the CPU/User threshold (ms) and Think maximum (ms) options are disabled.
CPU/User Threshold (ms)
This option specifies the dividing point, in milliseconds (ms), between CPU processing delays and delays due to user think time. In TestManager reports, delays that fall below the threshold you specify are considered CPU processing delays.
For example, an actual user might pause to think before selecting a student name from an SQL database. This delay is recorded as user think time. Once the user clicks the student name, the time spent generating the SQL command and accessing the atabase is a CPU delay.
Typical thresholds range from 0 through 10,000 ms (10 seconds). Valid thresholds range from 0 through 2,000,000,000 ms (just over 23 days). If you clear the CPU/User Threshold (ms) check box, all delays are considered think- time delays.
Think Maximum (ms)
Specifies the maximum think-time delay to allow in a script. If you specify a maximum think-time delay, no think-time delay in the script exceeds the one you specify. This feature could be useful when a script recording session is interrupted.
You can type a maximum think time or select one from the list. The valid range is 0 through 2,000,000,000 ms (just over 23 days).
If you clear the Think maximum (ms) check box, there is no limit to the length of a think-time delay.