Playwright · Junior · Question 51 of 75

How do you set the browser window size for tests?

Show the answer

Correct answer: use: { viewport: { width: 1280, height: 720 } }

Explanation

The viewport can be set globally, per project or with test.use. page.setViewportSize changes it inside a single test.

Further reading

Problem with a question

Playwright · Junior · question 51

Test yourself

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

Take this quiz