Menu
Choose a product
Viewing: v1.7.x (latest)
Find another version
Scroll for more
Documentation
Grafana k6
JavaScript API
k6/browser
BrowserContext
setDefaultNavigationTimeout(timeout)
Open source
setDefaultNavigationTimeout(timeout)
Sets the default maximum navigation timeout for Page.goto().
| Parameter | Type | Default | Description |
|---|---|---|---|
| timeout | number | Dependent on the action. | The timeout in milliseconds. |
Example
JavaScript
JavaScript
import { browser } from 'k6/browser';
export const options = {
scenarios: {
browser: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium',
},
},
},
},
};
export default async function () {
const context = await browser.newContext();
const page = await context.newPage();
context.setDefaultNavigationTimeout(1000); // 1s
try {
await page.goto('https://quickpizza.grafana.com/api/delay/5');
} finally {
await page.close();
}
}Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video

Performance testing and observability in Grafana Cloud
Optimize user experiences with Grafana Cloud. Learn real-time insights, performance testing with k6, and continuous validation with Synthetic Monitoring.
Events

User-centered observability: load testing, real user monitoring, and synthetics
Learn how to use load testing, synthetic monitoring, and real user monitoring (RUM) to understand end users' experience of your apps. Watch on demand.