lecture 2 of 180 completed

Watching what the app sends

Some bugs never appear on screen. waitForResponse lets you check the real request your app made.

What you'll learn

  • Why some bugs never appear on screen
  • How to wait for and inspect a real request
  • Why the listener must start before the action

Watching network traffic is standard practice on real Playwright teams. You cannot run it in the editor on this site, because our browser engine does not implement request interception. Everything below is real, working Playwright. Use it on a local project and it behaves exactly as described.

Here is a bug that a normal test will never catch.

You create a contact named Dana Fox at the company FoxLabs. The green message appears. The new row appears in the table. Everything looks correct on screen.

But the app sent an empty company name to the server. Nobody notices until a customer opens the record next week.

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →