By default, when you start recording a browser test, the mabl Trainer adds a visit URL step to the app.url under test. If you need to visit other URLs in a test, you can add additional visit URL steps from the Trainer step menu: Add step > Visit URL.
If the record button is on, the Trainer also captures visit URL steps when you enter a URL in the address bar and press enter.
This article highlights two common journeys where additional visit URL steps help:
- Start a test on a specific page or state
- Navigate to a URL that changes between runs
Start a test on a specific page or state
You can use a visit URL step as a shortcut to skip the navigation required to set up a specific page or state in your app. As long as you’ve validated site navigation in another test, this shortcut keeps tests focused and reduces run time.
For example, if it takes five clicks to get from the home page to a user’s account settings page, you can replace those clicks with a single visit URL step that goes directly to {{@app.url}}/account/settings.
You can also use this shortcut to set up a specific state on the page — for example, testing a product page with a discount code already applied by including the query parameter in the visit URL step: {{@app.url}}/products/123?discount=SUMMER20.
Navigate to a URL that changes between runs
Since visit URL steps support variable interpolation, you can use them to navigate to URLs that aren’t known ahead of time — URLs that depend on data generated earlier in the test.
For example, if your test completes a purchase and you want to verify the new order appears on its details page, you can:
- Capture the order ID from the confirmation page into a variable, such as
orderID. - Add a visit URL step that references the variable:
{{@app.url}}/orders/{{@orderID}}. - Add assertions to verify the order details.