|
| 1 | +--- |
| 2 | +id: kane-ai-drag-drop |
| 3 | +title: Drag and Drop for Web applications |
| 4 | +hide_title: false |
| 5 | +sidebar_label: Drag and Drop |
| 6 | +description: Learn how to test drag and drop interactions in KaneAI using natural language commands and manual recording for complex web interactions. |
| 7 | +keywords: |
| 8 | + - lambdatest automation |
| 9 | + - lambdatest kaneai |
| 10 | + - kaneai drag drop |
| 11 | + - drag and drop testing |
| 12 | + - click and drag |
| 13 | +url: https://www.lambdatest.com/support/docs/kane-ai-drag-drop/ |
| 14 | +site_name: LambdaTest |
| 15 | +slug: kane-ai-drag-drop/ |
| 16 | +--- |
| 17 | + |
| 18 | +import Tabs from '@theme/Tabs'; |
| 19 | +import TabItem from '@theme/TabItem'; |
| 20 | +import CodeBlock from '@theme/CodeBlock'; |
| 21 | +import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys"; |
| 22 | + |
| 23 | +A wide range of applications incorporate drag and drop features, enabling users to reorganize and position elements within the interface. KaneAI now supports **drag and drop** and **click and drag** interactions in web applications on Desktop, enabling you to test complex UI interactions like moving items between containers, adjusting sliders, resizing elements, and working with flow charts. This feature provides two methods for capturing these interactions: natural language commands and manual recording. |
| 24 | + |
| 25 | +## Supported Interaction Types |
| 26 | + |
| 27 | +### Drag and Drop (Natural Language) |
| 28 | +Use natural language commands to move elements between defined drop zones. This method is ideal for straightforward drag and drop operations where both the source and target elements are clearly visible. This is not ideal in case the source or the target elements are not clearly visible. |
| 29 | + |
| 30 | +**Examples:** |
| 31 | +- `Drag item 4 from source items to drop target` |
| 32 | +- `Drag and drop product card from available items to shopping cart` |
| 33 | +- `Move file from folder A to folder B` |
| 34 | + |
| 35 | +:::tip |
| 36 | +Natural language drag and drop works best when: |
| 37 | +- Drop zones are explicitly defined and visible |
| 38 | +- You're moving items between containers |
| 39 | +- The target location is static (not dynamically generated) |
| 40 | +::: |
| 41 | + |
| 42 | +### Click and Drag (Manual Interaction) |
| 43 | +Record click and drag actions manually during test authoring. This method provides precise control for complex interactions like sliders, resizing, and canvas operations. |
| 44 | + |
| 45 | +**Use Cases:** |
| 46 | +- Adjusting slider values |
| 47 | +- Resizing elements |
| 48 | +- Moving elements in flow charts |
| 49 | +- Dragging within canvas or drawing areas |
| 50 | + |
| 51 | +:::tip |
| 52 | +Manual recording is recommended for: |
| 53 | +- Slider adjustments |
| 54 | +- Element resizing |
| 55 | +- Flow chart interactions |
| 56 | +- Any scenario where drop locations aren't explicitly defined |
| 57 | +::: |
| 58 | + |
| 59 | +## Supported Scenarios |
| 60 | + |
| 61 | +### ✅ What Works |
| 62 | +- **Drag and Drop (Natural Language)** |
| 63 | + - Moving items between visible containers |
| 64 | + - Transferring elements to defined drop zones |
| 65 | + - Simple drag operations within the same page context |
| 66 | + - Kanban board card movements |
| 67 | + - File upload via drag and drop |
| 68 | +- **Click and Drag (Manual Interaction)** |
| 69 | + - All drag scenarios - works reliably in any case |
| 70 | + - Slider value adjustments |
| 71 | + - Resizing elements and panels |
| 72 | + - Drawing and canvas interactions |
| 73 | + - Flow chart and diagram manipulation |
| 74 | + - List item reordering |
| 75 | + - Precise positioning of elements |
| 76 | + |
| 77 | +### ⚠️ Limitations |
| 78 | + |
| 79 | +#### Natural Language Limitations |
| 80 | +- **List reordering** - Cannot reorder list items using natural language |
| 81 | +- **Pixel-based commands** - Cannot specify exact pixel offsets (e.g., "drag 50px right") |
| 82 | +- **Dynamic targets** - Cannot drag to targets that appear only during drag |
| 83 | +- **Undefined drop zones** - May not work if drop locations aren't explicitly defined |
| 84 | + |
| 85 | +#### General Limitations |
| 86 | +- **Cross-context dragging** - Cannot drag between iframes or shadow DOMs |
| 87 | +- **Multi-element dragging** - Cannot drag multiple elements simultaneously |
| 88 | +- **Mobile drag and drop** - Not supported on mobile devices |
| 89 | +- **Editing restrictions** - Click and drag instructions cannot be edited after recording |
| 90 | + |
| 91 | +### When to Use Each Method |
| 92 | + |
| 93 | +| Scenario | Natural Language | Manual Interaction | |
| 94 | +|----------|-----------------|------------------| |
| 95 | +| Container to container transfer | ✅ Recommended | ✅ Works | |
| 96 | +| Slider adjustments | ❌ Not supported | ✅ Recommended | |
| 97 | +| Element resizing | ❌ Not supported | ✅ Recommended | |
| 98 | +| List reordering | ❌ Not supported | ✅ Recommended | |
| 99 | +| Flow charts | ❌ Limited | ✅ Recommended | |
| 100 | +| Kanban boards | ✅ Recommended | ✅ Works | |
| 101 | +| Canvas drawing | ❌ Limited | ✅ Recommended | |
| 102 | + |
| 103 | + |
| 104 | +## Example Use Cases |
| 105 | + |
| 106 | +### E-commerce Product Sorting |
| 107 | +``` |
| 108 | +Drag product "iPhone 15" from available items to comparison table |
| 109 | +``` |
| 110 | + |
| 111 | +### Project Management Board |
| 112 | +``` |
| 113 | +Move task card from "To Do" column to "In Progress" column |
| 114 | +``` |
| 115 | + |
| 116 | +### Form Builder |
| 117 | +Use manual interaction to: |
| 118 | +- Drag form fields from palette to canvas |
| 119 | +- Resize input fields |
| 120 | +- Reorder form sections |
| 121 | + |
| 122 | +### Data Visualization Dashboard |
| 123 | +Use manual interaction to: |
| 124 | +- Adjust date range sliders |
| 125 | +- Resize chart panels |
| 126 | +- Rearrange dashboard widgets |
0 commit comments