Recording a service test through a client program
You can record tests for SOAP-based, XML, plain text, or binary services with any client program that uses the HTTP protocol. To record the test, the recorder intercepts the service calls and message returns between the client and the service. You can choose between an HTTP or SOCKS proxy recorder or a low-level socket recorder, depending on the capabilities of the client program.
Before you begin
- SOCKS proxy recorder: Use this recorder when no proxy connections are required.
- HTTP proxy recorder: Use this recorder when a proxy connections is required to connect to the network or when the client program does not support SOCKS.
- Socket recorder: Use this recorder for low-level network traffic when the client does not support proxies. This recorder does not support SSL authentication or encryption of any kind and is only available if the Test Performance Extension for Socket Protocols is installed.
If you are using Secure Sockets Layer (SSL), the HTTP or SOCKS proxy can cause authentication problems because the proxy recorder relays traffic between the client and the server. Depending on the authentication method in place, the client might require that the proxy recorder authenticate itself as the server and the server might require that the proxy recorder authenticate as the client. If the client program requires an authenticated server, you must either have access to the server certificate keystore and provide it to the proxy recorder or configure the client to accept the default certificate from the proxy recorder instead of the certificate from the actual server.
If you are testing a SOAP-based web service, ensure that you have access to a valid Web Services Description Language (WSDL) file. The wizard can import WSDL files from the workspace, the file system, a remote repository, or from a URL. Ensure that the WSDL files use the correct syntax for the test environment. The generic service client might not work with some WSDL files.
If you are using SOAP security, ensure that you have configured the environment with the correct libraries and configuration files. See Configuring the environment for SOAP security for more information.
Procedure
- In the Performance Test perspective, click the New Test from Recording toolbar button or click .
- In the New Test from Recording wizard,
click Create a test from a new recording, select Service
Test, and click Next.If you are recording sensitive data, you can select a Recording encryption level.
- On the Select Location page, select
the project and folder to create the test in, type a name for the
test, and click Next.If necessary, click Create Parent Folder to create a project or folder
- On the Select Client Application page,
select the type of client program to use.The program type defines the recorder that can be used. The following client program types are supported for recording a service test:
- Managed Application: This option starts
a specified program and uses a proxy or socket recorder to record
the traffic.
On the Managed Application Options page, click Browse to specify the Program path. If necessary, specify the Working directory, and type the command line Arguments that the program requires.
If the program requires user input from a command-line interface, select Open console for user input.
- Choose a web browser to record traffic that is sent and received with the web browser.
- Unmanaged Application: This option enables you to record traffic from one or multiple client programs that use a proxy. You must manually start the client programs and the proxy recorder records all traffic that is sent and received through the specified network port.
- Generic Service Client: This option uses the generic service client if you do not have access to a dedicated client for the service calls. See Recording a service test with the generic service client for using the generic service client to record service tests.
- Managed Application: This option starts
a specified program and uses a proxy or socket recorder to record
the traffic.
- On the Recorder Settings page, depending
on the type of client program you selected, specify these details:
- Click Next. If this is the first time you record a service test and you did not select a web browser for the client application, read the Privacy Warning, select Accept, and click Finish to proceed.
- If you selected a proxy recorder with a managed or unmanaged
application, change the network settings of the client program to
use the proxy recorder.The method for changing the network settings depends on the client program. However, you must be able to set the following proxy settings in the program:
- SOCKS or HTTP proxy: Specify the protocol that you selected for the proxy recorder in the wizard.
- Host name: Set to localhost.
- Port: Specify the port number that you selected for the proxy recorder in the wizard.
- Use the client program to perform the actions to test.
You can use the Recorder Test Annotations toolbar to add comments, record synchronizations, or take screen captures during the recording.
- To add a comment to the recorded test, click the Insert comment icon .
- To add a screen capture to the recorded test, click the Capture screen icon . Screen and window captures make your tests easier to read and help you visualize the recorded test. You can change the settings for screen captures and add a comment to the image.
- To manually add a synchronization point to the recording, click the Insert synchronization icon .
- To manually add a transaction folder to the recording, click the Start Transaction icon and Stop Transaction icon to start and stop the transaction.
- To insert a split point into the recorded test, click the Split point icon . With split points, you can generate multiple tests from a single recording, which you can replay in a different order with a schedule.
-
After you finish the user tasks in the client program, stop the recorder. You can do this
by closing the client program or by clicking the button Stop in the
Recorder Control view.
If you changed the network settings of the client program as described in step 8, you can revert to the default settings before closing the program.The Generate Service Test wizard opens.
- If you inserted a split point during the recording, on
the Destination page, specify the location for
the split test or merge the split recordings together.See Splitting a test during recording for more information about splitting tests.
- On the Service Test Generation Options page, if you are testing a SOAP-based web service, specify a Web Services Description Language (WSDL) file from the workspace or click Add to import a WSDL or to link to a remote WSDL file and click Next.
-
Select the domains to include in the test and click Finish. The
domains that are not selected are not included in the test. You can add them back by
generating the test again from the recording.
To include all the domains for all of the recordings, click the Select all and remember my decision check box. To enable the filter again for HTTP tests, click , and, for Service tests, click Service Test Generation and then click the Enable domain review before test generation check box.
- Click Finish.