Extension of application URL in Web UI tests

You are familiar with the feature to substitute text in the application URLs of Web UI tests. Starting from V10.1, you can extend the application URLs with substituted text from one Web UI test to other Web UI tests. This feature reduces your effort of manually substituting the application URLs in all your tests that have an application URL.

After you substitute a partial or an entire application URL used in a Web UI test for a particular phase of your project, you can extend the substituted application URL to the tests used in other phases of the project.

For example, if you have a project called abc, then the different phases of the project might have the following application URLs:

  • https://www.abcdev.com
  • https://www.abcprod.com
  • https://www.abcnonprod.com

You can also have different tests in each phase that tests different pages with the same primary URL. For example, https://www.abcprod.com/welcome.htm, https://www.abcprod.com/intro.htm.

If you want to change any part of the application URL, then you have to manually substitute the application URL in each test that uses the URL. This feature enables you to substitute the text in the application URL in any one test. You can then extend the substitution in the application URL across all tests that use the URL.

You can use different data sources that contain text values to replace the text in the URL. You can use the following types of data sources:

  • Built-in variable
  • Custom Java code
  • Dataset
  • Test variable
You can extend the substituted URL from a test to other tests by using either of the following methods:
Restriction: The extension of application URL in Web UI tests does not work as usual when tests match the following conditions:
  • The tests have a variable that is shared
  • The values of the shared variable are different in each test
The value of the shared variables in the application URL that you extend does not get updated in the application URL of the tests that receive the extended application URL.

For example, you have declared a variable VAR that you share between two tests, A and B. The value of the variable VAR is set as value1 for test A, and value2 for test B. If you substitute the variable VAR in the application URL in test A, and then extend the application URL to test B, the value of the substituted variable in the application URL of test B remains at value2 and is not replaced.