Recording a service test with the generic service client

You can record a service test by invoking a series of calls with the generic service client. After you have successfully invoked the calls, select the results in the History section of the generic service client to generate a test. If you do not have access to a dedicated Java™ client for the service calls, the generic service client is the easiest way to generate the calls and to record a test.

Before you begin

Verify that the Rational® Agent Controller is running on the local computer.

If your workspace does not already contain a test project, the test recording wizard creates one. If you want to generate a test in a specific project, verify that the project exists before you record the test.

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 Web Services Description Language (WSDL) files.

If you are using Secure Sockets Layer (SSL) authentication, ensure that you have any required key files in your workspace.

If you are using SOAP security or file attachments, ensure that you have configured the environment with the correct libraries and configuration files.

About this task

To record a test:

Procedure

  1. In the Test perspective, click File > New > Test from Recording or click the New Test from Recording (New Test from Recording button) toolbar button.
  2. Select Create test from new recording and Web service recording with generic service client; then click Next.
  3. Select a project, and then, in Test file name, type a name for the test. The name that you type is the base name for the recording, test, and other required files. You see these files in the standard Navigator or the Java Package Explorer with their distinguishing extensions, but you see only the simple (test) name in the Test Navigator.
  4. Click Next. If this is the first time you are recording a Web service test, read the Privacy Warning, and then select Accept, and click Finish to proceed. The generic service client opens.
  5. If your service uses a transport or security protocol that requires overriding the default settings, then click the Transport tab and create a new transport or security configuration.
  6. Click the Calls tab.
    • Select Add a WSDL file (Add a WSDL) to use a WSDL file from the workspace, to import a WSDL or to link to a remote WSDL file.
    • Select the Add an endpoint (Add an endpoint) file to create a call to an HTTP, JMS, or WebSphere® MQ service.
  7. After creating the call, click the Edit Call arrow to change the details of the call if necessary.
  8. Click the Invoke arrow to invoke the service call. If the call was successful, the response is displayed under the View Response arrow.
  9. If you want to record a test with multiple calls, repeat steps 6 through 9.
  10. When you have finished recording, click Stop Recording (Stop Recording button) . A progress window opens while the test is generated.

What to do next

Alternatively, you can use the generic service client to create, edit, and invoke the calls without recording. Successful responses are added to the Call History list. You can select calls in the Call History list, and click Generate Test Suite (Generate Test Suite) .

Feedback