Drag Web Element
Command description
Drag from the specified web element. The virtual mouse does not take control of the physical pointer, and the command activates the element's webpage.
If the element is outside the viewport, the command scrolls it into view before dragging.
Drag distances use physical pixels. JavaScript element.getBoundingClientRect() returns CSS pixels; multiply them by devicePixelRatio to obtain physical pixels.
The width, height, position, and slider CAPTCHA distance obtained from web elements are all measured in physical pixels.
Command Input Parameters
| input parameters | Input parameter type | Description |
|---|---|---|
| Webpage Object | WebPage | Webpage containing the target element |
| Web Element | WebElement or str (captured element UID, not element name, not ms-rpa-id) | Select a captured element or one returned by Get Web Element, Get Similar Web Elements, or Get Related Web Elements |
| Drag Method | enum | Mouse Drag, CDP Silent Drag |
| Horizontal Drag Distance | number | Horizontal distance in physical pixels; positive moves right and negative moves left |
| Vertical Drag Distance | number | Vertical distance in physical pixels; positive moves down and negative moves up |
| Mouse Pointer Position | enum | Random, Center; starting position within the element |
| Element Wait Duration | number | Maximum time to wait for the element to appear, in seconds |
Command Output Parameters
None
Type definition reference
Drag method
| Drag method | Description |
|---|---|
| Mouse Drag | Brings the browser to the foreground and performs a physical mouse drag |
| CDP Silent Drag | Drags through Chrome CDP without using the physical mouse or bringing the browser forward. It can run when the browser is off-screen or covered by another window |
tip
- Install the Runavelo browser extension before using this command.
- CDP Silent Drag requires Runavelo 7.7.0 or later and browser extension 2.4.0 or later.
Example
Drag a verification slider.