Creating and editing Rational Performance Tester scripts with Test Perspective

Tip: For more information, see the Rational® Performance Tester product online help.

You can create Rational Performance Tester scripts of the following types with Test Perspective. Before creating a Rational Performance Tester script, you must install Rational Performance Tester Workbench.

  1. From the Rational Performance Tester, create a new test from the recording:
    1. Select File > New > Test from Recording.
    2. Select the type of recording and click Next.
      Remember: This procedure of recording new scripts varies, depending on what type of the script you are creating. You can find out more information about recording a script in the Rational Performance Tester help.
      • To record HTTP/HTTPS scripts for Response Time, always select RPT HTTP Recording.
      • To record Web Services/SOA scripts, if you select Web service Recording using Generic Service Client option, you can import an existing WSDL file and add the endpoint information; if you select Web service or XML Recording using Existing Client (HTTP Proxy), web service calls and network traffic is routed through a HTTP proxy on the recorder of Rational Performance Tester and is used with existing web services client applications.
      • To playback a Rational Performance Tester script when a proxy server is needed to reach the target web application, ensure that both of the following proxy configuration conditions are met:
        • The Robotic Response Time agent is configured with the proxy server definition.
        • The Rational Performance Tester script source includes the appropriate proxy data settings.

        Record your script using the Rational Performance Tester Workbench and specify the proxy settings in the recording.

        If the proxy information or authentication needed during script playback differs from the settings saved in the Rational Performance Tester script, then you must also define these playback proxy settings in the Robotic Response time agent configuration. These settings will be used after the Robotic Response Time agent determines that the proxy agent cannot be reached, or if the configured user name and password do not successfully authenticate to the proxy server.

        Limitation: The playback will use the agent configured proxy details or the realm authentication credentials when the playback of the script fails. However, this is only done once, so either the proxy details or the authentication credentials are used, but not both at the same time.

      • To record Oracle ERP Rational Performance Tester scripts, select Oracle Recorder. The Oracle Recorder option is displayed after the BSD Oracle plug-in is installed and configured correctly. BSD Oracle plug-in is supported, as an extension to Rational Performance Tester. To install the BSD Oracle plug-in, after Rational Performance Tester is installed, perform the following steps:
        1. Extract the .zip file of the BSD Oracle plug-in to the following directories, where RPT_install_dir is installation directory of Rational Performance Tester (The default is C:\Program Files\IBM\SDP).
          • RPT_install_dir\rptse\dropins\eclipse
          • RPT_install_dir\dropins\eclipse
        2. Install the license file for the BSD Oracle plug-in. A license server is required for enabling the license. For detailed information about how to enable the license, see BSD documentation.
        3. Start Rational Performance Tester with the -clean option so that the plug-ins are reloaded.
        4. Click Window > Preferences. The Preferences window is displayed.
        5. In the left pane, expand Test and select Oracle Applications Extension.
        6. In the Oracle Applications Extension pane, specify the license file path in the BSD Group license path field.
        7. Click Apply, and then click OK.
        For more detailed installation and configuration instructions, see BSD documentations.
    3. Select a project.
    4. Type the filename for the test you want to create and click Finish.
      Note: Be sure to use only ASCII characters in the name, otherwise you might encounter problems later when you playback the script.
  2. Use Performance Test Generator to access a test site and record transactions. For more information, see the Rational Performance Tester product online help.
  3. (Optional) Create a datapool.

    A datapool provides variable data during test runs. Rational Performance Tester scripts use data from when the test was recorded. By associating a datapool with a test at runtime, you can substitute the variable data in the datapool for the data in the test.

    1. Select File > New > Datapool.
    2. Specify a name and location for the datapool file.
    3. Specify the number of variables (columns) that you want and click Next.
    4. Specify the number of records (rows) that you want and click Next.
    5. Specify the name, type of action, and the location of the datapool variable and click OK.
    6. Associate the datapool with a test.
      1. Click Add datapool in the common options tab of a test.
      2. Select the datapool you want to use.
    7. Associate a request in the test with a Datapool column
      1. Select a request in the test. The candidates for datapool appear in green in Test Element Details.
      2. Right-click the candidate and click Substitute From > Datapool Variable.
      3. Select the Datapool column and click Use Column.
    8. (Optional) Encrypt a datapool column.
      1. Click on the column header for a variable and the Edit Variable window opens.
      2. Select the Encrypt check box.
      3. Click OK and the Set Password window opens.
      4. Type password you want to use for the variable and click OK.

        The datapool variable is now encrypted.

  4. (Optional) Create verification points
    Note: You must enable the corresponding verification points in the Rational Performance Tester test before you upload the test script with Multi File Uploader
    Verification Points are a way to do the following things:
    • Detect problems in an application, such as: Does the web page contain the expected information? Is this the expected window?
    • Enforce an Service Level Agreement so that you can verify that each page in the transaction sequence to multiple pages is correct
    The following verification points are included in Test Perspective:
    • Content Verification Point searches for a specific string on a page.
    • Page Title Verification Point compares the page title against the recorded title.
    • Response Code Verification Point compares the HTTP code returned against the recorded code.
    • Response Size Verification Point compares the page size returned against the recorded size.
    • Custom if custom code is added to a test, returns a pass status when the custom class returns a pass status after performing a verification written in Java code.
    Tip: For HTTP scripts, Rational Performance Tester automatically sends a URL unavailable message if the site is down, even if you did not enable verification points for the script. Response Time looks for these messages and sends an event to the Tivoli Enterprise Monitoring Server. For Web Services scripts, Rational Performance Tester does not automatically send any Unavailability or error message when the site is down, so you must enable verification points for web service scripts if you want to receive availability violations.
    1. Open the test for which you want to create custom code.
    2. Right-click a test element and do one of the following:
      • To append custom code to the bottom of the test element, click Add > Custom Code .
      • To append custom code above the selected test element, click Insert > Custom Code.
    3. In Test Element Details, specify a new or an existing class name.
    4. Click Generate Code to create skeleton code.
    5. Edit the existing or skeleton code and click Add.
  5. (Optional) Further customize the script with Custom Code. Custom code extends Rational Performance Tester tests by:
    • Adding custom logging
    • Providing runtime data values to the test.
    • Adding custom verification points
    • Running external programs
      Additional Information
      Use ICustomCode2 and ITestExecutionServices interfaces to create custom code and extend test execution.

      Interfaces for creating custom code are in the com.ibm.rational.test.lt.kernel.services package.

      Add any external jars referenced by the Custom code to the Java™ build path of the project.

      Example of Custom Code
      Text preceded by * indicates an explanation.
      Example of how to log messages to the execution history of the test
      execution history custom code
  6. (Optional ARM Enablement for HTTP scripts only) By default only the main pages of the script are ARM enabled when exported. Page elements (such as .gifs or .javascript) are not ARM enabled. You can change this by setting the ARM instrumentation level from within the script:
    1. Switch to the Performance Test perspective.
    2. Edit the script.
    3. Select the root of the test.
    4. Click Enable Response Time Breakdown to ARM-enable all pages and page elements such as .gifs or .javascript.
    5. Export the script using the ITCAM export wizard.
  7. Export the script to the Application Management Console.
  8. If you have not already done so, use the Application Management Configuration Editor to define the applications and transactions you want to monitor with this robotic script. (Using the Application Management Configuration Editor)