URL Replacements
  • 13 Dec 2022
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

URL Replacements

  • Dark
    Light

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].

URL_replacement_2_en.png

Specify [URL to be replaced] and [URL after replacement], and click [Create].
URL_replacement_3_en.png

You can also replace multiple URLs:

URL_replacement_1_en.png

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.


Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.