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
[Feature]: Mouse.dragAndDrop
API not supported for WebDriver BiDi
#12293
Comments
This issue was not reproducible. Please check that your example runs locally and the following:
Once the above checks are satisfied, please edit your issue with the changes and we will |
I'm not sure why the analyzer has trouble reproducing this because |
Yeah, those are not supported since WebDriver does not define those events that CDP provides. Can you use the alternative API that causes drag event as the side effect of mouse events instead of dispatching drag events directly? Example from tests:
Note that currently only Chrome synthesizes additional events for mouse events. |
cc @whimboo |
Alternatively, it should be possible to drag and drop using mouse events directly:
|
Thank you for the feedback! We currently use https://github.com/mozilla/pdf.js/blob/master/test/integration/test_utils.mjs#L356-L359 and that works. It's mainly that I was reading the documentation and thought that using the (I mainly got curious to try it out and then ran into this and figured I should at least report the finding upstream, but fortunately there is no real need to replace the current code.) |
Thanks, actually, the current way you use is the preferred way and we might deprecate dragAndDrop eventually since it injects drag events directly without emulating mouse/pointer input. |
Mouse.dragAndDrop
API not supported for WebDriver BiDiMouse.dragAndDrop
API not supported for WebDriver BiDi
Minimal, reproducible example
Error string
UnsupportedOperation
Bug behavior
Background
For Mozilla's PDF.js project we use the WebDriver BiDi protocol for Firefox at the moment (to test it and provide early feedback). I tried to replace our custom drag-and-drop code with the native
Mouse.dragAndDrop
API provided by Puppeteer, see https://pptr.dev/api/puppeteer.mouse.draganddrop, but while this works for CDP it doesn't work for WebDriver BiDi as an unsupported operation exception is raised.(I have filed this as a bug because the APIs are not equal between CDP and WebDriver BiDi, and dragging-and-dropping is not a very rarely used operation I think, but could also understand if this is seen as a missing feature instead; in that case please feel free to move/amend the issue description.)
Expectation
Mouse.dragAndDrop
works equally for CDP and WebDriver BiDi.Reality
Mouse.dragAndDrop
works for CDP, but doesn't seem to be supported in WebDriver BiDi.Puppeteer configuration file (if used)
No response
Puppeteer version
22.6.5
Node version
21.7.2
Package manager
npm
Package manager version
10.5.2
Operating system
Linux
The text was updated successfully, but these errors were encountered: