How to select a dropdown option using playwright in JavaScript?

Viewed 8632

I would like to select "All" option from the below DOM using Playwright JS, and I have tried page.selectOption('select#rows per page', '-1'); and page.selectOption('id=mui-55656', '-1'); to no avail. Any help would be appreciated. Thanks. enter image description here

1 Answers

You should be able to select the option using the aria-label

await page.selectOption('[aria-label="rows per page"]', '-1');
Related