I'm trying to iterate over a list of dynamic elements with Playwright, I've tried a couple of things already, but none have been working:
await this.page.locator('li').click();
const elements = await this.page.locator('ul > li');
await elements.click()
await this.page.$$('ul > li').click();
await this.page.click('ul > li');
const divCounts = await elements.evaluateAll(async (divs) => await divs.click());
this.page.click('ul > li > i.red', { strict: false, clickCount: 1 },)
const elements = await this.page.$$('ul > li > i.red')
elements.forEach(async value => {
console.log(value)
await this.page.click('ul > li > i.red', { strict: false, clickCount: 1 },)
await value.click();
})