Add mouse_select_option for native select dropdowns (#375)#391
Open
FazeelUsmani wants to merge 1 commit intoServiceNow:mainfrom
Open
Add mouse_select_option for native select dropdowns (#375)#391FazeelUsmani wants to merge 1 commit intoServiceNow:mainfrom
FazeelUsmani wants to merge 1 commit intoServiceNow:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #375.
Native
<select>dropdowns render their option list as a browser/OS-level popup that Playwright's synthetic mouse events can't reach, somouse_click(x, y)on a<select>opens the dropdown but never picks an option.Adds a
mouse_select_option(x, y, options)action to thecoordsubset, mirroring the bid-basedselect_option. The lookup usesdocument.elementFromPointand descends through open shadow roots and same-origin iframes (closed shadow roots and cross-origin frames are not reachable from JS). Wraps the call incall_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.