Skip to content

← All questions

Is XPath actually forbidden in a page object, or only discouraged?

Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.

Reviewer left "never XPath" on my proposal. The locator strategy page says CSS or XPath as a last resort inside a page object with a heal context, which reads like "allowed but grudgingly".

The element in question is a legacy table cell with no role, no test id and no stable class, and the only thing that identifies it is its position relative to a label. Which is it?

2 answers

Know the answer?

Wrap commands and output in triple backticks and they will render as a code block.

Checking whether you’re signed in…

Have a different question? Ask it.

Related