Playwright · Senior · Question 57 of 77

Why might page.waitForURL be needed after a form submit?

Show the answer

Correct answer: To make sure navigation finished before the next step

Explanation

Actions don't wait for navigation they start. Asserting toHaveURL or a visible element on the next page syncs the test.

Further reading

Problem with a question

Playwright · Senior · question 57

Test yourself

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

Take this quiz