Playwright · Junior · Question 20 of 75

When does Playwright resolve a locator to an element?

Show the answer

Correct answer: Each time an action or assertion uses it

Explanation

Locators are lazy. They're re-evaluated on every use, so they keep working after re-renders that replace DOM nodes.

Further reading

Problem with a question

Playwright · Junior · question 20

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