- Print
- DarkLight
What are URL replacements?
Do you use several environments when making changes to your corporate website? These environments can go by many names; staging, dev, production, etc. Typically, each environment has a different URL, but the websites tested are the same.
With Autify's URL replacement feature, you won't have to create a new scenario for each URL. Simply replace the relevant URLs in the scenario and start running tests.
How to set up URL replacements
Open the Test Plan Details Page. Under [URL Replacements], click [Add].
Specify [URL to be replaced] and [URL after replacement], and click [Create].
You can also replace multiple URLs:
All URLs within the scenario that exactly match [URL to be replaced] will be replaced with [URL after replacement].
The following URLs will be replaced:
- The start URL in the first step of the Scenario.
- URLs of Go-To Steps in the Scenario.
- URLs in steps within Step Groups you may have used in the Scenario. (If the URL within a Step Group is overwritten with [URL to be replaced], it will be replaced with the URL specified in [URL after replacement] before execution.)
- URLs of "URL Should Be" assertion step in the Scenario.
- URLs of "URL Should Contain" assertion step in the Scenario.
- URLs in the JS Step used in the Scenario.
- URLs in JS snippets called in the Scenario.
When you execute a test plan, all URLs within the existing scenario will be replaced from [URL to be replaced] with the URL you specified in the [URL after replacement].
Examples
Here are three examples of how URLs in scenarios are replaced.
In this example, we assume that there are two URLs we want to replace. We will call them Replacement 1 and Replacement 2.
In Case 1, the URL in the scenario is an exact match with [URL to be replaced], so it's replaced with the URL specified in [URL after replacement].
URLs are replaced starting from the longest [URL to be replaced].
Therefore, in Case 2, Replacement 2 is applied instead of Replacement 1.
In Case 3, Replacement 1 is applied - the front part of the URL is replaced.
URL to be replaced | URL after replacement | |
---|---|---|
Replacement 1 | https://dev .example.com | https://prd .example.com |
Replacement 2 | https://dev .example.com/project1 | https://prd .example.com/projectA |
URL in the scenario | URL after replacement | Replacement | |
---|---|---|---|
Case 1 | https://dev .example.com | https://prd .example.com | Replacement 1 |
Case 2 | https://dev .example.com/project1 | https://prd .example.com/projectA | Replacement 2 |
Case 3 | https://dev .example.com/home | https://prd .example.com/home | Replacement 1 |
Note:
If you plan to use the URL replacement feature to create test plans for different execution environments, we recommend that you name your scenario with URL replacement in mind.