Skip to content
Advertisement

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 🙁

Advertisement

Answer

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

page.locator("abc div")
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement