1

I have a locator for a dropdown list which implemented as virtual list, below is the way I'm fetching list options

dropdown_locator.evaluate_handle('$0 => Array.from($0.__dropdownOptions)

result of this call is a collection of JSHandle objects - how do I select some dropdown option on my page using one of returned objects?

1
  • 1
    It's very difficult to help without the site and a minimal reproducible example. Every site is different, but normally you'd use locator.select_option() rather than element handles, which you almost never need. Prefer locators. If by "virtual list" you mean the dropdown is comprised of non-<select>/<option> elements, normal clicks and keyboard presses should work. If you're doing web scraping, sometimes setting the .value = "..." and issuing an event inside an .evaluate() block works, or finding another way to trigger the event.
    – ggorlen
    Commented Nov 5, 2024 at 14:48

1 Answer 1

0

There is no way to click on the element directly from the jshandle object, if you have "lazy-list", you either have to scroll your dropdown by locators and wait until desired element appears or use search input to truncate the list of options

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.