This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
unroute(url)
The method removes all routes for the url, that were previously added with
page.route.
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();
// Abort all image requests
await page.route(/(\.png$)|(\.jpg$)/, async function (route) {
await route.abort();
});
await page.goto('https://quickpizza.grafana.com/');
await page.getByRole('button', { name: 'Pizza, Please!' }).click();
// Stop aborting all image requests
await page.unroute(/(\.png$)|(\.jpg$)/)
await page.close();
}

