Editing URLs and Hostnames¶
There are several scenarios where you need to modify recorded URLs:
- Change hostname: Test against a different environment (staging vs. production)
- Edit path segments: Handle dynamic content in URL paths
- Modify query parameters: Vary data per user or iteration
- Delete unwanted URLs: Remove transactions that aren't part of the test scenario
Changing Hostnames (Testing Different Environments)¶
When you record against one environment (e.g., staging.example.com) but need to test against another (e.g., production.example.com), you can change the hostname for all transactions at once.
Method 1: Hostname Resolution (Global)
- Open Preferences: Window → Preferences
- Navigate to: Web Performance → Hostname Resolution
- Click: Add
- Original hostname:
staging.example.com - Replacement hostname:
production.example.com - Click: OK
All transactions to staging.example.com will now be sent to production.example.com during replay.
Hostname Resolution vs. Editing URLs
Hostname Resolution is global: it affects all test cases in your workspace. If you only want to change the hostname for one specific test case, use Method 2 (edit URLs directly).
Method 2: Edit URLs Directly (Per Test Case)¶
- Select the transaction with the URL you want to edit
- Open Headers View
- Click: Edit the Start Line button
- Modify the URL components:
- Protocol: http or https
- Hostname: Change to the target environment
- Port: Change if needed
- Path segments: Edit individual path elements
- Query parameters: Edit parameter values
- Click: OK
Method 3: Mass-Edit Hostnames in the Fields View (Per Test Case)¶
To retarget every transaction in one test case at once, without touching the rest of your workspace, use the Fields View hostnames layout. See Retarget every hostname to a different server.
Editing URL Path Segments for Dynamic Content¶
For URLs with dynamic path segments (like the dynamic file download example), you can configure each segment to use a user variable, dataset value, or constant.
Example dynamic URL:
To make 12345 (user ID) and 67890 (order ID) dynamic:
- Select the transaction in Test Case Editor
- Open Headers View
- Click: Edit the Start Line
- Select path segment:
12345 - Choose: Use User Variable or Use Dataset
- Enter variable name (e.g.,
user_id) or select dataset field - Repeat for
67890(order ID) - Click: OK
Best Practice: Test Hostname Changes with Small Replays First¶
Why: Changing hostnames affects all transactions. A small replay (1 virtual user) quickly verifies the target environment is reachable and configured correctly.
How: Configure Hostname Resolution → Run 1-user replay → Verify all transactions succeed → Then run full load test.