Skip to content

← All questions

Can I put an XPath in the css fallback list of a heal context?

Asked 11,470 views2 answers

Our app renders a summary table where the only stable thing about a row is its position relative to a header cell. The reviewer agent keeps flagging the selector, so I was going to declare a fallback for it:

ts
readonly total = this.heal.locator(this.page.locator('.summary .total'), {
  description: 'order total',
  css: ['xpath=//table[@id="summary"]//tr[last()]/td[2]'],
});

Does the healer accept that? And if it does, is it a terrible idea?

asked by Kostya Petrov7,903 ·

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