In this article, we will see how we can navigate to URL in playwright Using 'goto,' we can navigate between URLs in playwright.
goto returns the primary resource response, and in case of multiple redirects, it resolves to the first non-redirect response.
await page.goto(url); await page.goto(url, options);
- There's an SSL error related to the signed certificates of the site.
- Invalid URL.
- Exceeding timeout.
- Unreachable server.
- The resource failed to load.
Arguments Used In goto:
- Type string is passed.
- Pass in the URL to navigate to the page.
- It should include a scheme like https://.
- When baseURl via context is provided, it is passed via a new URL() constructor.
These are entirely optional.
Referer:- Referer header value can be provided as an option.
Timeout:- Timeout in milliseconds default is 30secs.
waitUntil:- Used to wait until dom content loaded, load, network idle, etc.