Skip to content

← All questions

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

Asked 7,060 views2 answers

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?

asked by Koen Vermeulen309 ·

2 answers

Know the answer?

Reviewed before it appears. Wrap commands and output in triple backticks and they will render as a code block.

Have a different question? Ask it.

Related