---
title: "goto(url[, options]) | Grafana k6 documentation"
description: "Browser module: frame.goto(url[, options]) method"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# goto(url\[, options])

Navigates to the specified URL and returns the main resource response.

Navigating to `about:blank` or navigation to the same URL with a different hash, will succeed and return `null`.

Expand table

| Parameter         | Type   | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|-------------------|--------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| url               | string | `''`    | URL to navigate frame to. The url should include scheme, e.g. `https://`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| options           | object | `null`  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| options.referer   | string | `''`    | Referer header value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| options.timeout   | number | `30000` | Maximum operation time in milliseconds. Pass `0` to disable the timeout. The default value can be changed via the [browserContext.setDefaultNavigationTimeout(timeout)](/docs/k6/next/javascript-api/k6-browser/browsercontext/setdefaultnavigationtimeout/), [browserContext.setDefaultTimeout(timeout)](/docs/k6/next/javascript-api/k6-browser/browsercontext/setdefaulttimeout/), [page.setDefaultNavigationTimeout(timeout)](/docs/k6/next/javascript-api/k6-browser/page/setdefaultnavigationtimeout/) or [page.setDefaultTimeout(timeout)](/docs/k6/next/javascript-api/k6-browser/page/setdefaulttimeout/) methods. Setting the value to `0` will disable the timeout. |
| options.waitUntil | string | `load`  | When to consider operation to have succeeded. See [Events](#events) for more details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

### Events

> Caution
> 
> `networkidle` is DISCOURAGED. Don’t use this method for testing especially with chatty websites where the event may never fire, rely on web assertions to assess readiness instead.

Events can be either:

- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
- `'load'` - consider operation to be finished when the `load` event is fired.
- `'networkidle'` - Consider operation to be finished when there are no network connections for at least `500` ms.

### Returns

Expand table

| Type                        | Description                                                                                                                        |
|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| `<Promise<Response | null>` | The [Response](/docs/k6/next/javascript-api/k6-browser/response/)&gt; instance associated with the frame. Else, it returns `null`. |
