BrauzerLab
← Back to missions 41 / 50

Block Analytics

Medium ~240 sec

Web pages often send tracking requests in the background. In Playwright tests you can block these requests to isolate page behaviour.

page.route() lets you intercept matching requests. Calling route.abort() inside the handler prevents the request from reaching the server.

page is already available. No setup required — you can block requests matching the **/analytics** pattern directly with page.route.

Several correct URL patterns are accepted: full path, glob, or substring — all work.

TASK

Block the analytics request.

Provided for you
import { test, expect } from '@playwright/test';

test('Block Analytics', async ({ page }) => {
  await page.goto('https://lab.local/mission/block-analytics');
  // ↓ Your code goes below ↓
});
Editor
https://lab.local/mission/block-analytics
Loading...
Results will appear here — press Run or Check.