Skip to main content

How to monitor network events when testing using Playwright

Javascript / Typescript

Updated 1 min readMarkdown

How to log network requests made when a Playwright test runs

page.on('request', request =>
      console.log('>>', request.method(), request.url()));

How to log network responses received when a Playwright test runs

page.on('response', response =>
      console.log('<<', response.status(), response.url()));

Sources

No comments yet. Be the first to comment.