Interaction

Drag And Drop

Performs a drag-and-drop gesture on the matched element, moving it by the specified horizontal and vertical pixel deltas. The deltas and all required coordinate information is encoded in the selector X/Y, OffsetX/Y and DeltaX/Y.

Examples

GPAL Fluent: High-level fluent C# API

browser.WithSelector(selector).DragAndDrop();

MagicHelper: MagicHelper utility library

browser.MagicHelper.DragAndDrop("element123", 100, 50);

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.DragAndDrop(selector).WithDeltaX(100).WithDeltaY(50).Execute();

Puppeteer Communicator: Low-level communicator

//Takes the element itself rather than a selector, and the offsets say where inside it the drag starts, which defaults to the middle.

await browser.PuppeteerCommunicator.DragAndDrop(GPALElement element, string sessionId, List<dynamic> responses, int deltaX, int deltaY, int offsetX, int offsetY);

REST Client: Direct REST/HTTP client

browser.OttoMagicClient.WithEndpoint(ApiEndpoint.DragAndDrop).WithElementId(selector).WithDeltaX(100).WithDeltaY(50).Execute();

💬 Ask GPAL