Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the selected options label text for a multi-select dropdown? #30580

Closed
1 task done
YadaGiriReddy opened this issue Apr 27, 2024 · 2 comments
Closed
1 task done

Comments

@YadaGiriReddy
Copy link

YadaGiriReddy commented Apr 27, 2024

Please do not submit this issue.

  • I understand
@YadaGiriReddy
Copy link
Author

YadaGiriReddy commented Apr 27, 2024

I tried to use the below code snippet for getting the selected options label text from a multi-select dropdown, but the the property 'selectedOptions' isn't available on the HTMLElement type. How can we overcome this issue?

const selectedOptionsText = await page.$eval('selector', (select) => { return Array.from(select.selectedOptions).map(option => option.textContent); });

@dgozman
Copy link
Contributor

dgozman commented Apr 29, 2024

The issue tracker is reserved for bug reports and feature requests.

For anything else, such as questions or getting help, please see:

@dgozman dgozman closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants