You can't guard a value that doesn't exist yet
Description and use
In WebDriverAgent on iOS 18.5, a drag gesture after an app switch caused a hang and an infinite-point error. The fix introduces a new method that resolves coordinates immediately, validates them, and synthesizes the event, eliminating the hang and returning a clear 400 error.
Problem
Drag gestures in WebDriverAgent hang and fail with an infinite-point assertion when the target app is busy after a switch.
Outcome
The new implementation removes the hang, provides a clear 400 error for invalid parameters, and aligns WDA’s drag behavior with W3C actions.
Workflow
- 1. Resolve start and end coordinates immediately using screenPoint.
- 2. Validate that both points are finite; if not, return a 400 error with a clear message.
- 3. Map velocity to XCTest’s pixels-per-second values (default 500, slow 250, fast 750).
- 4. Build the touch event path: press, hold, drag, hold, lift.
- 5. Send the event directly to FBXCTestDaemonsProxy, bypassing XCTest’s snapshot and idle wait.
- 6. Wait up to animationCoolOffTimeout after the gesture, mirroring W3C actions.
- 7. Return success or a 400 error based on validation.
- 8. Update /wda/dragfromtoforduration and /wda/pressAndDragWithVelocity to use the new method.
Evidence
unknown error: Invalid parameter not satisfying: point.x != INFINITY && point.y != INFINITY
Both endpoints called -[XCUICoordinate pressForDuration:thenDragToCoordinate:(withVelocity:thenHoldForDuration:)]
A new -[XCUIApplication fb_pressAtCoordinate:forDuration:thenDragToCoordinate:withVelocity:thenHoldForDuration:error:]
- Record date: 2026-10-14T13:41:20.101Z