[英]How to select a dropdown option using playwright in JavaScript?
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');
我想使用 Playwright JS 从下面的 DOM 中选择 select “All”选项,并且我已经尝试过
page.selectOption('select#rows per page', '-1');
and page.selectOption('id=mui-55656', '-1');
和
page.selectOption('id=mui-55656', '-1');
to no avail.无济于事。 Any help would be appreciated.
任何帮助,将不胜感激。 Thanks.
谢谢。
You should be able to select the option using the aria-label
您应该能够使用
aria-label
来 select 选项
await page.selectOption('[aria-label="rows per page"]', '-1');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.