Playwright · Junior · Question 17 of 75

Which attribute does getByTestId('submit') look for by default?

Show the answer

Correct answer: data-testid

Explanation

By default it matches data-testid="submit". The attribute name can be changed with testIdAttribute in the config, e.g. to data-qa.

Further reading

Problem with a question

Playwright · Junior · question 17

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