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

Have the same question?

Ask it with the command you ran and the output you got, and it will be answered here.

Ask a question

Related