Playwright · Senior · Question 57 of 77
Why might page.waitForURL be needed after a form submit?
- 1Because
click()fails if the URL changes - 2It's needed after every action in Playwright
- 3To make sure navigation finished before the next step
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.