click(forDuration:thenDragTo:)
Clicks and holds an element for a duration you specify, and then drags it to another element.
Declaration
func click(forDuration duration: TimeInterval, thenDragTo otherElement: XCUIElement)Parameters
- duration:
The duration of the initial click and hold.
- otherElement:
The element over which to finish the drag.
Discussion
Specify a duration long enough to initiate a drag operation. If the element exists within a scrollable view but is offscreen, the framework attempts to scroll the element onscreen before performing the click.