Search code examples
javascriptcypressplaywrightbrowser-automation

playwright equivalent of find() in cypress


Is there a way to traverse through html elements in playwright like cy.get("abc").find("div") in cypress?

In other words, any find() equivalent method in playwright?

page.locator("abc").find() is not a valid method in playwright though :(


Solution

  • You can just combine the selectors, this will resolve to div below abc

    page.locator("abc div")