Playwright · Middle · Question 48 of 75

How do you read the texts of all matching elements?

Show the answer

Correct answer: await items.allTextContents()

Explanation

allTextContents and allInnerTexts return arrays but don't wait. Prefer toHaveText([...]) for assertions, which retries.

Further reading

Problem with a question

Playwright · Middle · question 48

Test yourself

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

Take this quiz