title: Is there a way to iterate over a <li> list in Playwright and click over each element?
body: <p>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:</p>
  <pre><code>await this.page.locator('li').click();
  const elements = await this.page.locator('ul &gt; li');
  await elements.click()
  </code></pre>
  <pre><code>await this.page.$$('ul &gt; li').click();
  </code></pre>
  <pre><code>await this.page.click('ul &gt; li');
  </code></pre>
  <pre><code>const divCounts = await elements.evaluateAll(async (divs) =&gt; await divs.click());
  </code></pre>
  <pre><code>this.page.click('ul &gt; li &gt; i.red', { strict: false, clickCount: 1 },)
  </code></pre>
  <pre><code>const elements = await this.page.$$('ul &gt; li &gt; i.red')
  
  elements.forEach(async value =&gt; {
    console.log(value)
    await this.page.click('ul &gt; li &gt; i.red', { strict: false, clickCount: 1 },)
    await value.click();
  })
  </code></pre>
  <pre><code></code></pre>