Additional options are provided for running the same test against multiple environments as well as overriding existing behavior.
After recording a test, you have a number of options to modify the test’s behavior to suit your requirements.
Executing on Different Environments
Often times you’ll record your tests against a dedicated QA environment, but will want to run all or a subset of those tests against another environment such as Staging or Prod.
In Reflect, you can run the same tests against multiple environments without having to duplicate the test or re-record any existing behavior.
To run tests against a different environment:
Create a new Tag and add this new tag to all of the tests that should execute against this other environment.
Next, select the Tag on the Tests List page and click ‘Configure Tag and Schedule’.
Under ‘Request Overrides’, click the ‘Add Override’ button and select ‘Hostname’
In the new section that appears, enter the hostname that you want to replace in the leftmost section, and enter the environment you want to run against in the rightmost section.
So for example if you recorded all your tests against qa.example.com, but wanted to run them against staging.example.com when this tag executes, then define your overrides as shown in the screenshot below:
Optionally you can run your tests against a different port by specifying it in the hostname override. For example, if you recorded all of your tests against qa.example.com and wanted to run them against staging.example.com:1234, simply include it in the ‘hostnames’ value from the screenshot above.
Optionally you can also override any Variables defined in your tests.
For example, if the login credentials of your test user are different between environments, you can assign the credentials to Variables and override them as shown in the screenshot above.
The URL path, protocol, and query parameters will remain the same when overriding a hostname. If a port was specified in the original URL, it will be preserved unless a new value is specified in the hostname override.
Overriding Query Parameters
Another type of Request Override Reflect supports is Query Parameter overrides.
One common use-case for this type of overrides is bypassing authentication flows.
Infrastructure providers such as Firebase support the notion of auth tokens which are short-lived shared secrets that allow you to immediately authenticate as a specific user without entering a username or password.
To add or override a query parameter to all tests:
Select the Tag you’ll be executing (or choose the All Tests tag) and click ‘Configure Tag and Schedule’.
Under ‘Request Overrides’, click the ‘Add Override’ button and select ‘Query Parameter’
Enter the name and value of the parameter you wish to include in all tests.
This parameter will be appended to the start URL of each test when test execution begins.
If the parameter already is present in the start URL, the parameter’s existing value will be overwritten.
Table of Contents
Get started with Reflect today
Create your first test in 2 minutes, no installation or setup required.
Accelerate your testing efforts with fast and maintainable test suites without writing a line of code.