IKivan-kozenko -aqa
Try yourself as a QA tester
Back to topic

Quiz

Locators

Check yourself

  1. 1.A developer renames the CSS class on a Submit button from .btn-submit to .btn-primary. Which locator will NOT break?
  2. 2.You have a table with 20 order rows. You want to click the 'Cancel' button only in the row that contains 'ORDER-042'. What do you use?
  3. 3.Playwright throws 'strict mode violation: locator resolved to 5 elements' when you call .click(). What does this mean?
  4. 4.An element has no accessible role, no label, and no stable visible text. When is getByTestId the right choice?
  5. 5.What does page.getByRole('listitem').nth(2) return?
  6. 6.When is getByAltText the appropriate locator?
  7. 7.You want to find the 'Edit' button only inside a specific row of a table. How should you write this?
  8. 8.If you call .click() on a locator that matches 3 elements, what happens?