This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
reload([options])
This reloads the current page and returns the main resource response.
Events
Caution
networkidleis 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 theDOMContentLoadedevent is fired.'load'- consider operation to be finished when theloadevent is fired.'networkidle'- Consider operation to be finished when there are no network connections for at least500ms.
Returns
Example
import { browser } from 'k6/browser';
export const options = {
scenarios: {
browser: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium',
},
},
},
},
};
export default async function () {
const page = await browser.newPage();
await page.goto('https://test.k6.io/browser.php');
await page.reload();
}

