Skip to content

← All questions

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

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.

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?

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