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

The following recorders are available for recording traffic from an application:
  • 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 HCL OneTest™ Performance Extension for Socket Protocols is installed.
Regardless of the recorder that you use, the client program must use the HTTP network protocol. For recording Java™ Message Service (JMS) or IBM® WebSphere® MQ tests, see Recording a service test with the generic service client.

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

To record a service test with a client program:

  1. In the Performance Test perspective, click the New Test from Recording toolbar button New Test from Recording toolbar button or click File > New > Test from Recording.
  2. 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.
  3. 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 Create Parent Folder icon to create a project or folder
  4. 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.
  5. On the Recorder Settings page, depending on the type of client program you selected, specify these details:
    1. If you selected Managed Application, specify the recording method.
      • Select Record traffic with the proxy recorder to record HTTP or SOCKS traffic through a proxy.
      • Select Record traffic with the socket recorder to record low-level network traffic for applications where a proxy cannot be used. This recorder does not support SSL authentication or encryption.
      Note: When using proxy recording, you can filter out HTTP or HTTPS requests to a specific endpoints so that any requests to those endpoints are not recorded. See Proxy recording preferences
    2. If you selected Record traffic with the proxy recorder, specify whether the proxy recorder uses HTTP or SOCKS. Select HTTP if a connection to proxy is required or if your application does not support SOCKS.
    3. If you are using SSL authentication, specify the authentication settings for the proxy recorder. During the recording, the proxy recorder is between the client and the server.
      • If the server requires client SSL authentication, provide the client certificate for the proxy recorder to be authenticated by the server as though the proxy recorder were the client. Select The server requires a specific client certificate.

        To provide single certificate keystore, specify the file name and password of the server certificate keystore. If multiple certificates are required, click Multiple certificates, and click Add to specify a certificate keystore file name and password for each host name and port.

      • To record a secured site using Internet Explorer or Google Chrome on Windows, install the recorder certificate by selecting Register the recorder root certificate authority. Before the recording starts, the browser prompts you to install the certificate. After the recording is stopped, the browser prompts you to uninstall the certificate. To avoid multiple prompts for each recording, select Keep the recorder root certificate authority after recording.
        Note: If you already had the certificate from a version prior to 9.2.1 and then install the latest version of the product, you might have to install the certificate again.
        This option is not available when you record by using the Firefox or Safari browser. To record a secured site on these browsers, manually import the certificate in the browser from the default location C:\Program Files (x86)\HCL\HCLIMShared\plugins\com.ibm.rational.test.lt.recorder.proxy_version\SSLCertificate. For information about how to import the certificates, see the browser's documentation.
      • If the client requires server authentication, you must provide the server certificate keystore for the proxy recorder to be authenticated by the client as though the proxy recorder were the server. Select The client requires a specific server certificate, and click Add to specify a certificate keystore filename and password for each hostname and port. If you do not select this option, the proxy recorder provides its own default certificate.
        Note: The keystore must contain the private certificate of the server.
    4. If you selected to use the HTTP proxy recorder, specify how to connect to the network. If necessary, specify an HTTP or SOCKS proxy or point to a proxy auto-configuration (PAC) file. Use this option if you are connecting to the service through a corporate proxy or firewall.
  6. 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.
  7. 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.
    To avoid unexpected results, revert to the previous proxy settings before you stop the recording.
  8. 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 Insert comment icon.
    • To add a screen capture to the recorded test, click the Capture screen icon 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 Insert synchronization icon.
    • To manually add a transaction folder to the recording, click the Start Transaction icon Start Transaction icon and Stop Transaction Stop Transaction icon icon to start and stop the transaction.
    • To insert a split point into the recorded test, click the Split point icon 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.
  9. 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 Stop icon 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.
  10. 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 an HTTP test during recording for more information about splitting tests.
  11. 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.
  12. 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 Window > Preferences > Test > Test Generation > HTTP Test Generation, and, for Service tests, click Service Test Generation and then click the Enable domain review before test generation check box.
  13. Click Finish.

Results

A progress window opens while the test is generated. On completion, the Recorder Control view displays the Test generation completed message, the test navigator lists your test, and the test opens in the test editor.
Feedback