URL Replacements
  • 22 Sep 2022
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

URL Replacements

  • Dark
    Light

※ English in this website is translated using machine translation. Please note that the content may not be 100% accurate.


## What are URL replacements?


Most companies have more than one environment that they use in order to make changes to their website. These environments can go by many names; staging, dev, production, etc and they typically have separate URL's but are part of the same website.

In comes Autify's URL replacement feature! Instead of having to create an entirely new scenario for a new URL, you can just indicate what URL you would like to replace the original URL with.

Setting up URL replacements

Open the Test Plan Details screen, and under "URL Replacement in Scenario," click on the "Add" button.

URL_replacement_2_en.png

Specify the "URL to be replaced" (before) and "URL after replacement" (after), respectively, and click the "Create" button.
URL_replacement_3_en.png

You can also replace each URL if there are multiple URLs you wish to replace.

URL_replacement_1_en.png

The URLs specified in "URL after a replacement" will be all URLs in the scenario that match the "URL to be replaced".
The URL to be replaced are as follows.

Start URL in the first step of the "scenario"
URL of a step in the middle of the "scenario" to which a transition is made by specifying a URL.
URL in the step in the "step group" being used in the "scenario " (if the value of "step group" is overridden by "URL to be replaced", it will be replaced by the URL specified in "URL after a replacement")
URL within the "URL Should Be ○○" assertion used in the "Scenario".
URL in the "JS Step" used in the "Scenario" URL in the "JS Step" used in the "Scenario"
URL within a JS snippet called in a "scenario" URL within a "JS snippet" used in a "scenario"

When executing the test plan, all URLs in the existing scenario will be replaced with the "URL to be replaced" before execution.

Usage Example

The following are three concrete examples of how URLs in a scenario will be replaced.
In this example, we assume that there are two "URLs to be replaced," and for the convenience of explanation, we will refer to them as "Replacement 1" and "Replacement 2," respectively.

For Pattern 1, the URL in the scenario is an exact match with the "URL to be replaced," so the URL is replaced with the URL specified in "URL after a replacement".

In addition, when replacing, the URLs are applied in the order of the length of the "URL to be replaced" from the longest to the shortest.
Therefore, for Pattern 2, Replacement 2 is applied instead of the Replacement 1.

For Pattern 3, substitution specification 1 is applied and the forward part of the URL is substituted.

URL to be replaced URL after a replacement
Replacements 1 https://dev.example.com https://prd.example.com
Replacements 2 https://dev.example.com/project1 https://prd.example.com/projectA
URL in the scenario URL after a replacemen Replacements
Pattern1 https://dev.example.com https://prd.example.com Replacements 1
Pattern2 https://dev.example.com/project1 https://prd.example.com/projectA Replacements 2
Pattern3 https://dev.example.com/home https://prd.example.com/home Replacements 1

*Note.
When using the URL replacement function to create test plans for different execution environments, we recommend that you name your scenario with URL replacement in mind.


Next Section: Test Results from Test Plans


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.