Playwright · Senior · Question 39 of 77

What should a team policy on data-testid say?

Show the answer

Correct answer: Use it when role and name aren't stable or unique

Explanation

Roles test accessibility for free. Test IDs fill gaps like repeated cards or canvas widgets, and should be stable, not generated.

Further reading

Problem with a question

Playwright · Senior · question 39

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