Playwright · Junior · Question 18 of 75
What does getByText('Welcome') match by default?
- 1Only elements whose whole text is exactly it
- 2Only headings and paragraphs with that text
- 3Elements containing that text, case-insensitive
Show the answer
Correct answer: Elements containing that text, case-insensitive
Explanation
By default matching is a case-insensitive substring with whitespace normalized. Pass { exact: true } for exact matching or a regular expression for patterns.