This step navigates to a specific path or URL during the action phase of a scenario. The value in quotes is appended to the launch URL, so relative paths must start with a leading slash. When the value is a full URL (starting with https://) it is used directly without prepending the launch URL. After navigation the step waits for the body element to be attached and then waits for the page load to settle.
The pronoun prefix (I go, I navigate, we go, we navigate, or navigating) is optional and does not change behaviour. This step is most useful when a scenario needs to navigate away from the current page to trigger a redirect, test access control, or verify that a link lands on the expected destination.
Accepted phrasings
When I go to "/contact-us.html"
When I go to "/account/login"
When I navigate to "/dashboard"
When navigating to "/products"
When we go to "/products"
When we navigate to "/terms"
Examples
When I go to "/contact-us.html"
When I navigate to "/account/login"
When navigating to "/products"
When we go to "/terms"
In a real scenario
Scenario: Verify that anonymous users cannot access restricted pages
Given I am an anonymous user
When I go to "/admin"
And wait
Then I should see "Access denied"