Skip to content

Add mouse_select_option for native select dropdowns (#375)#391

Open
FazeelUsmani wants to merge 1 commit intoServiceNow:mainfrom
FazeelUsmani:fix/coord-action-native-select
Open

Add mouse_select_option for native select dropdowns (#375)#391
FazeelUsmani wants to merge 1 commit intoServiceNow:mainfrom
FazeelUsmani:fix/coord-action-native-select

Conversation

@FazeelUsmani
Copy link
Copy Markdown

Fixes #375.

Native <select> dropdowns render their option list as a browser/OS-level popup that Playwright's synthetic mouse events can't reach, so mouse_click(x, y) on a <select> opens the dropdown but never picks an option.

Adds a mouse_select_option(x, y, options) action to the coord subset, mirroring the bid-based select_option. The lookup uses document.elementFromPoint and descends through open shadow roots and same-origin iframes (closed shadow roots and cross-origin frames are not reachable from JS). Wraps the call in call_fun(do, retry_with_force) for parity with the rest of the action set.

Tests cover top-level, same-origin iframe (via srcdoc=), and open shadow root.

Approach proposed by @imenelydiaker in the issue thread.

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

Successfully merging this pull request may close these issues.

Issues with the coordinates action space

1 participant