microsoft / playwright-java

Java version of the Playwright testing and automation library
https://playwright.dev/java/
Apache License 2.0
1.07k stars 195 forks source link

Find Xpath or Path or JsPath of an element from the locator in Playwright Java #1619

Open ThatYodaCoder opened 4 days ago

ThatYodaCoder commented 4 days ago

IS there anyway to find the xpath/path/jspath of an element from the locator in playwright java apis?

mxschmitt commented 2 days ago

There is no such way as of today. We recommend using a Locator to perform actions from it. For what do you need the xpath for? Maybe we have a method for it already / or we make a feature request out of it. Thanks!