This will navigate to google.com, but there's no validation beyond that. Unless the page timed out, page.goto isn't going to throw an exception.
A good element to look for on the google homepage is the ubiquitous search box, which can be identified using the selector/locator //textarea[@name="q"]. So we can add that in after the page.goto navigation like this to validate that it is visible:
Feedback from @tom-miseur and user, we're missing a simple tutorial explaining how a user can check that a page has successfully loaded.
Example from @tom-miseur:
The most reliable way to check that a page has successfully loaded is to look for a specific web element to appear once an action has been performed.
To demonstrate:
This will navigate to google.com, but there's no validation beyond that. Unless the page timed out, page.goto isn't going to throw an exception.
A good element to look for on the google homepage is the ubiquitous search box, which can be identified using the selector/locator //textarea[@name="q"]. So we can add that in after the page.goto navigation like this to validate that it is visible: