Add "Drag And Drop Across Frames" keyword for cross-frame drag and drop support#1953
Add "Drag And Drop Across Frames" keyword for cross-frame drag and drop support#1953b-vamsipunnam wants to merge 5 commits intorobotframework:masterfrom
Conversation
91af1a0 to
d283eb4
Compare
d283eb4 to
bf869a0
Compare
|
Hi @emanlove ,
All tests are now passing in GitHub Actions. Please take another look when you have a chance. Thanks! |
yuriverweij
left a comment
There was a problem hiding this comment.
Thanks for this PR! it looks very promising, but there are a few things that need to be resolved.
- There is a bug in the try/except which can cause the mouse button to stay down.
- The test fixture (html file) has some problems which can give false positives
- Suggestion: the keyword can be made a bit more generic allowing dragging from frame to frame or default context to frame. (in this case the Note can be removed from the docstring)
- Suggestion: add the following to the docstring/description
After this keyword runs, the browser context is always default content, regardless of the context before the call.
|
Hi @yuriverweij Thanks for the detailed feedback. I’ve updated the fixture so the drop completes only when the mouseup occurs within the target element inside the target iframe, avoiding false positives. The keyword now also supports an optional source frame and ensures the mouse is released on failure before resetting context. @emanlove: If this looks good, could you please consider adding the |
yuriverweij
left a comment
There was a problem hiding this comment.
On test doesn't do what it claims to do. For the rest it looks good to me.
Maybe @emanlove still has some other suggestions/feedback and I'll let him have the final say.
|
Hi @yuriverweij : Thanks for all the feedback. I’ve addressed the comments and made the suggested updates. Happy to make any further changes if needed. Thank you. |
Summary
This PR adds a new keyword
Drag And Drop Across Framesto support drag-and-drop interactions where the source and target are in different frame contexts.Motivation
While automating post-deployment flows in a Salesforce Service Cloud setup, I encountered a limitation where drag-and-drop failed when the drop target was inside an iframe. Existing keywords do not support this scenario because WebDriver action chains lose context when switching frames mid-action.
Real-world scenario (Salesforce Service Cloud):
Login → Setup → All Sites → Builder → Select Dashboard → Drag and drop a component into a target section (inside an iframe) → Publish
The existing
Drag And Dropkeyword fails in this case because the target resides inside an iframe.This aligns with known limitations:
This keyword enables reliable end-to-end automation for such scenarios.
Changes
All acceptance tests pass locally, including the new cross-frame scenarios.
All acceptance tests pass locally (including new ones).
This addresses a long-standing limitation around cross-frame drag-and-drop. If applicable, please consider adding the
acknowledgmentlabel to #120 for release notes. Thank you!