Reusing tests on different hosts: Server connection variables

Your tests represent a significant investment in time and effort. You can share or reuse them for different configurations and web hosts by changing the variables for the host name and port.

Before you begin

Before you begin, confirm that test generation preferences are set to support data correlation. Click Window > Preferences > Test > Performance Test Generation > HTTP Test Generation, click the Data Correlation tab, and verify that Automatically correlate host and port data is selected. If not, select that option and regenerate the test.

About this task

Perhaps you develop the tests on a lab computer and then they want to run them on a production server. If the application that you are testing is identical on both computers, you can change the host name and reuse the tests on the production server.

Procedure

To change the name of the host or proxy server on all requests in a test:

  1. In the Test Navigator, browse to the test and double-click it. The test opens.
  2. Expand the Test Variable section at the top of the test, and click the Server Connection variable that contains the hostname that you want to change.
  3. In the Test Element Details area, perform the following steps:
    1. Type the new host name in the Host field.
    2. Optional: Type a new port number in the Port field.
    The new hostname and port combination is correlated to the test variable, which contains the value currently being used.

Results

Note: To change the host names and ports of many tests, put the server connection variable in a datapool and associate the datapool with the tests. When you change the name and port in the datapool, that change is propagated throughout the tests in the datapool. For more information, see Creating a datapool associated with a test.
Feedback