I'm trying to select an option from dropdown select which contains an optgroup.
<select name="someName">
<optgroup label="A">
<option value="AC">AC</option>
<option value="Abarth">Abarth</option>
<option value="Acura">Acura</option>
<option value="Aixam">Aixam</option>
<option value="Alfa Romeo">Alfa Romeo</option>
<option value="Alpina">Alpina</option>
</optgroup>
<optgroup label="B">
<option value="Bentley">Bentley</option>
<option value="Bugatti">Bugatti</option>
</optgroup>
</select>
How I can select an option from the select above regardless its optgroup?
If there's no a optgroup the Standart selecting is working
await page.select('select[name="someName"]', 'Alfa Romeo');
It works with and without
optgroupelement,page.select()does handle it for you.For showcasing it, here's an example which selects different elements and waits 2 seconds between it. Watch it in browser!