Skip to content

← All questions

Our nth-child selectors break every sprint and healing never rescues them

Asked 8,940 views3 answers

Inherited suite, roughly two hundred locators in this shape:

ts
readonly price = this.heal.locator(
  this.page.locator('.results > div:nth-child(3) > span:nth-child(2)'),
  { description: 'first result price', css: ['.results div:nth-child(3) span'] },
);

Every time the results list gains a badge or a promo row, a chunk of them break, and they break with HEAL_FAILED rather than healing. The contexts are declared, so I expected at least some recovery. What am I supposed to do with two hundred of these?

asked by Tanvi Bhatt126 ·

3 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