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

Quiz

Other locators

Check yourself

  1. 1.Your page has a table of orders. Each row has an order number and a 'Cancel' button. You want to click Cancel for the row with order number 'ORD-1042'. There's no unique test id on the button. What's the cleanest approach?
  2. 2.What does the :visible CSS pseudo-class do in Playwright selectors?
  3. 3.What is the recommended priority order for choosing a locator strategy in Playwright?
  4. 4.What does nth=-1 select when used with a locator?
  5. 5.You need to locate an input field that has no label or placeholder, but is positioned to the right of the text 'Username'. Which locator should you use?
  6. 6.What is the key difference between :has-text() and :text() CSS pseudo-classes in Playwright?
  7. 7.Why are XPath locators considered a last resort in Playwright?
  8. 8.A page has both a visible dropdown and a hidden mobile dropdown with the same CSS class. page.locator('.dropdown').click() throws a strict mode violation. What is the cleanest fix?