Playwright · Middle · Question 42 of 75

How do you test how a page behaves offline?

Show the answer

Correct answer: await context.setOffline(true)

Explanation

Offline mode makes requests fail like real network loss. Combine it with checks of offline banners or retries.

Further reading

Problem with a question

Playwright · Middle · question 42

Test yourself

Take the Playwright · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz