-
Notifications
You must be signed in to change notification settings - Fork 449
Description
Severity: High - Causes automated tests to fail
Description:
When performing a drag operation using the /wda/dragfromtoforduration interface after switching between different applications, the interface response becomes extremely slow and eventually returns an error indicating invalid parameter point coordinates.
Reproduction Path:
-
Prerequisites:
- WebDriverAgent is running.
- Apps A and B are installed on the device.
- WDA service is running at
http://localhost:12001. - A valid WDA
sessionId(e.g.,8EDB641E-B827-4E0E-8D0F-94631D03F076).
-
Reproduction Steps:
- Step 1: Open App A.
- Step 2: Call the
/wda/dragfromtofordurationinterface to perform the drag operation.curl -X POST http://localhost:12001/session/8EDB641E-B827-4E0E-8D0F-94631D03F076/wda/dragfromtoforduration -H ‘Content-Type: application/json’ -d ‘{“fromX”: 10,“fromY”: 700,“toX”: 10,‘toY’: 300,“duration”: 0.3}’- Expected Result: The phone performs the swipe operation normally, and the interface responds quickly with a success return.
- Actual result: Phone performs normal drag, API responds normally.
- Step 3: Return to the system home screen.
- Step 4: Open App B.
- Step 5: Call the
/wda/dragfromtofordurationAPI again to perform the same drag operation.curl -X POST http://localhost:12001/session/8EDB641E-B827-4E0E-8D0F-94631D03F076/wda/dragfromtoforduration -H ‘Content-Type: application/json’ -d ‘{“fromX”: 10,“fromY”: 700,“toX”: 10,‘toY’: 300,“duration”: 0.3}’- Expected Result: The phone performs the swipe operation normally, and the API responds quickly with a success return.
- Actual Result: The phone appears to become very sluggish, the API responds abnormally slowly, and after waiting for some time, the following error message is returned:
Error Message:
curl -X POST \
http://localhost:12001/session/8EDB641E-B827-4E0E-8D0F-94631D03F076/wda/dragfromtoforduration \
-H 'Content-Type: application/json' \
-d '{
"fromX": 10,
"fromY": 700,
"toX": 10,
"toY": 300,
"duration": 0.3
}'
response
{
"value" : {
"error" : "unknown error",
"message" : "Invalid parameter not satisfying: point.x != INFINITY && point.y != INFINITY",
"traceback" : "(\n\t0 CoreFoundation 0x000000019144f228 7821F73C-378B-3A10-BE90-EF526B7DBA93 + 1155624\n\t1 libobjc.A.dylib 0x000000018e8e9abc objc_exception_throw + 88\n\t2 Foundation 0x000000019074d670 34DE055D-8683-380A-9198-C3347211D13D + 7988848\n\t3 XCUIAutomation 0x0000000103118f0c -[XCPointerEventPath initForTouchAtPoint:offset:].cold.1 + 92\n\t4 XCUIAutomation 0x00000001030c9008 -[XCPointerEventPath initForTouchAtPoint:offset:] + 240\n\t5 XCUIAutomation 0x00000001030846a8 XCUIPressHoldDragWithVelocityAndHoldEvent + 148\n\t6 XCUIAutomation 0x00000001030b07a8 __116-[XCUICoordinate(XCUICoordinateTouchEvents) pressForDuration:thenDragToCoordinate:withVelocity:thenHoldForDuration:]_block_invoke + 200\n\t7 XCUIAutomation 0x00000001030ea194 __137+[XCUIElement(XCUIElementEventSynthesis) _dispatchEventWithEventBuilder:eventSynthesizer:withSnapshot:applicationSnapshot:process:error:]_block_invoke.32 + 136\n\t8 XCTestCore 0x0000000102f40c50 +[XCTFuture futureWithDescription:block:] + 116\n\t9 XCUIAutomation 0x00000001030e9d48 __137+[XCUIElement(XCUIElementEventSynthesis) _dispatchEventWithEventBuilder:eventSynthesizer:withSnapshot:applicationSnapshot:process:error:]_block_invoke_2 + 376\n\t10 XCTestCore 0x0000000102f3ea18 -[XCTContext _runActivityNamed:type:block:] + 204\n\t11 XCTestCore 0x0000000102f3d4b0 -[XCTContext runInternalActivityNamed:block:] + 152\n\t12 XCUIAutomation 0x00000001030e9b78 __137+[XCUIElement(XCUIElementEventSynthesis) _dispatchEventWithEventBuilder:eventSynthesizer:withSnapshot:applicationSnapshot:process:error:]_block_invoke + 256\n\t13 XCTestCore 0x0000000102f3f0ac +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 180\n\t14 XCTestCore 0x0000000102f3f200 -[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 84\n\t15 XCUIAutomation 0x00000001030e9930 +[XCUIElement(XCUIElementEventSynthesis) _dispatchEventWithEventBuilder:eventSynthesizer:withSnapshot:applicationSnapshot:process:error:] + 392\n\t16 XCUIAutomation 0x00000001030ea8b4 -[XCUIElement(XCUIElementEventSynthesis) _dispatchEventWithEventBuilder:error:] + 1000\n\t17 XCUIAutomation 0x00000001030eab74 __70-[XCUIElement(XCUIElementEventSynthesis) _dispatchEvent:eventBuilder:]_block_invoke + 120\n\t18 XCTestCore 0x0000000102f3ea18 -[XCTContext _runActivityNamed:type:block:] + 204\n\t19 XCTestCore 0x0000000102f3d4b0 -[XCTContext runInternalActivityNamed:block:] + 152\n\t20 XCUIAutomation 0x00000001030eaa70 -[XCUIElement(XCUIElementEventSynthesis) _dispatchEvent:eventBuilder:] + 256\n\t21 XCUIAutomation 0x00000001030b06a0 -[XCUICoordinate(XCUICoordinateTouchEvents) pressForDuration:thenDragToCoordinate:withVelocity:thenHoldForDuration:] + 484\n\t22 WebDriverAgentLib 0x0000000106a935a0 +[FBElementCommands handleDrag:] + 736\n\t23 WebDriverAgentLib 0x0000000106a1d3fc -[FBRoute_TargetAction mountRequest:intoResponse:] + 168\n\t24 WebDriverAgentLib 0x0000000106a05c54 __37-[FBWebServer registerRouteHandlers:]_block_invoke + 432\n\t25 WebDriverAgentLib 0x0000000106a40144 -[RoutingHTTPServer handleRoute:withRequest:response:] + 168\n\t26 WebDriverAgentLib 0x0000000106a40c38 __72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 64\n\t27 libdispatch.dylib 0x00000001992da584 395DA84F-715D-334E-8D41-A16CD93FC83C + 112004\n\t28 libdispatch.dylib 0x00000001992d0800 395DA84F-715D-334E-8D41-A16CD93FC83C + 71680\n\t29 libdispatch.dylib 0x00000001992da584 395DA84F-715D-334E-8D41-A16CD93FC83C + 112004\n\t30 libdispatch.dylib 0x00000001992f75a0 395DA84F-715D-334E-8D41-A16CD93FC83C + 230816\n\t31 libdispatch.dylib 0x00000001992cfd30 395DA84F-715D-334E-8D41-A16CD93FC83C + 68912\n\t32 libdispatch.dylib 0x00000001992cfc6c _dispatch_main_queue_callback_4CF + 44\n\t33 CoreFoundation 0x00000001913a1d90 7821F73C-378B-3A10-BE90-EF526B7DBA93 + 445840\n\t34 CoreFoundation 0x00000001913454f4 7821F73C-378B-3A10-BE90-EF526B7DBA93 + 66804\n\t35 CoreFoundation 0x0000000191346c3c CFRunLoopRunSpecific + 572\n\t36 Foundation 0x000000018ffbe79c 34DE055D-8683-380A-9198-C3347211D13D + 63388\n\t37 WebDriverAgentLib 0x0000000106a04998 -[FBWebServer startServing] + 336\n\t38 WebDriverAgentRunner 0x0000000102d74230 -[UITestingUITests testRunner] + 80\n\t39 CoreFoundation 0x0000000191364a94 7821F73C-378B-3A10-BE90-EF526B7DBA93 + 195220\n\t40 CoreFoundation 0x000000019136410c 7821F73C-378B-3A10-BE90-EF526B7DBA93 + 192780\n\t41 XCTestCore 0x0000000102ed14c4 +[XCTFailableInvocation invokeStandardConventionInvocation:completion:] + 68\n\t42 XCTestCore 0x0000000102ed1478 __90+[XCTFailableInvocation invokeInvocation:withTestMethodConvention:lastObservedErrorIssue:]_block_invoke_3 + 28\n\t43 XCTestCore 0x0000000102ed0bac __81+[XCTFailableInvocation invokeWithAsynchronousWait:lastObservedErrorIssue:block:]_block_invoke + 364\n\t44 XCTestCore 0x0000000102ebcbe4 __49+[XCTSwiftErrorObservation observeErrorsInBlock:]_block_invoke + 36\n\t45 XCTestCore 0x0000000102f516e4 $sIyB_Ieg_TR + 24\n\t46 XCTestCore 0x0000000102f5161c $sSo24XCTSwiftErrorObservationC10XCTestCoreE14_observeErrors33_4641E344ACA55A25D2B1EC985574C54DLL2inSo0abC6ResultCSgyyXE_tFZyyXEfU_ + 60\n\t47 XCTestCore 0x0000000102f51810 $sSo24XCTSwiftErrorObservationC10XCTestCoreE14_observeErrors33_4641E344ACA55A25D2B1EC985574C54DLL2inSo0abC6ResultCSgyyXE_tFZyyXEfU_TA + 32\n\t48 libswift_Concurrency.dylib 0x000000019cee5afc $ss9TaskLocalC9withValue_9operation4file4lineqd__x_qd__yKXESSSutKlF + 232\n\t49 XCTestCore 0x0000000102f51520 $sSo24XCTSwiftErrorObservationC10XCTestCoreE14_observeErrors33_4641E344ACA55A25D2B1EC985574C54DLL2inSo0abC6ResultCSgyyXE_tFZ + 420\n\t50 XCTestCore 0x0000000102f51698 $sSo24XCTSwiftErrorObservationC10XCTestCoreE14_observeErrors33_4641E344ACA55A25D2B1EC985574C54DLL2inSo0abC6ResultCSgyyXE_tFZTo + 104\n\t51 XCTestCore 0x0000000102ebcadc +[XCTSwiftErrorObservation observeErrorsInBlock:] + 208\n\t52 XCTestCore 0x0000000102ed0940 +[XCTFailableInvocation invokeWithAsynchronousWait:lastObservedErrorIssue:block:] + 228\n\t53 XCTestCore 0x0000000102ed1160 +[XCTFailableInvocation invokeInvocation:withTestMethodConvention:lastObservedErrorIssue:] + 540\n\t54 XCTestCore 0x0000000102ed1568 +[XCTFailableInvocation invokeInvocation:lastObservedErrorIssue:] + 72\n\t55 XCTestCore 0x0000000102f0e5c0 -[XCTestCase invokeTestMethod:] + 64\n\t56 XCTestCore 0x0000000102f0efc4 __24-[XCTestCase invokeTest]_block_invoke_2.115 + 56\n\t57 XCTestCore 0x0000000102f17664 -[XCTMemoryChecker _assertInvalidObjectsDeallocatedAfterScope:] + 84\n\t58 XCTestCore 0x0000000102f1251c -[XCTestCase assertInvalidObjectsDeallocatedAfterScope:] + 92\n\t59 XCTestCore 0x0000000102f0ee4c __24-[XCTestCase invokeTest]_block_invoke.108 + 460\n\t60 XCTestCore 0x0000000102ef03ac -[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] + 168\n\t61 XCTestCore 0x0000000102f0e884 -[XCTestCase invokeTest] + 632\n\t62 XCTestCore 0x0000000102f1059c __26-[XCTestCase performTest:]_block_invoke.166 + 36\n\t63 XCTestCore 0x0000000102ef03ac -[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] + 168\n\t64 XCTestCore 0x0000000102f0ffd4 __26-[XCTestCase performTest:]_block_invoke.151 + 552\n\t65 XCTestCore 0x0000000102f3f0ac +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 180\n\t66 XCTestCore 0x0000000102f3ef94 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 104\n\t67 XCTestCore 0x0000000102f0fa6c -[XCTestCase performTest:] + 308\n\t68 XCTestCore 0x0000000102efb910 -[XCTest runTest] + 48\n\t69 XCTestCore 0x0000000102ee8ef8 -[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] + 68\n\t70 XCTestCore 0x0000000102ee8dac __27-[XCTestSuite performTest:]_block_invoke + 164\n\t71 XCTestCore 0x0000000102ee87e4 __59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke + 48\n\t72 XCTestCore 0x0000000102f3f0ac +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 180\n\t73 XCTestCore 0x0000000102f3ef94 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 104\n\t74 XCTestCore 0x0000000102ee8754 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 180\n\t75 XCTestCore 0x0000000102ee8a34 -[XCTestSuite performTest:] + 220\n\t76 XCTestCore 0x0000000102efb910 -[XCTest runTest] + 48\n\t77 XCTestCore 0x0000000102ee8ef8 -[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] + 68\n\t78 XCTestCore 0x0000000102ee8dac __27-[XCTestSuite performTest:]_block_invoke + 164\n\t79 XCTestCore 0x0000000102ee87e4 __59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke + 48\n\t80 XCTestCore 0x0000000102f3f0ac +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 180\n\t81 XCTestCore 0x0000000102f3ef94 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 104\n\t82 XCTestCore 0x0000000102ee8754 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 180\n\t83 XCTestCore 0x0000000102ee8a34 -[XCTestSuite performTest:] + 220\n\t84 XCTestCore 0x0000000102efb910 -[XCTest runTest] + 48\n\t85 XCTestCore 0x0000000102ee8ef8 -[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] + 68\n\t86 XCTestCore 0x0000000102ee8dac __27-[XCTestSuite performTest:]_block_invoke + 164\n\t87 XCTestCore 0x0000000102ee87e4 __59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke + 48\n\t88 XCTestCore 0x0000000102f3f0ac +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 180\n\t89 XCTestCore 0x0000000102f3ef94 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 104\n\t90 XCTestCore 0x0000000102ee8754 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 180\n\t91 XCTestCore 0x0000000102ee8a34 -[XCTestSuite performTest:] + 220\n\t92 XCTestCore 0x0000000102efb910 -[XCTest runTest] + 48\n\t93 XCTestCore 0x0000000102f06ff0 __89-[XCTTestRunSession executeTestsWithIdentifiers:skippingTestsWithIdentifiers:completion:]_block_invoke + 104\n\t94 XCTestCore 0x0000000102f3f0ac +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 180\n\t95 XCTestCore 0x0000000102f3ef94 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 104\n\t96 XCTestCore 0x0000000102f06eb0 -[XCTTestRunSession executeTestsWithIdentifiers:skippingTestsWithIdentifiers:completion:] + 296\n\t97 XCTestCore 0x0000000102f14c6c __72-[XCTExecutionWorker enqueueTestIdentifiersToRun:testIdentifiersToSkip:]_block_invoke_2 + 148\n\t98 XCTestCore 0x0000000102f1606c __XCTAsyncEnumerateWithWaiter_block_invoke + 256\n\t99 XCTestCore 0x0000000102f16224 __XCTAsyncEnumerate_block_invoke.116 + 64\n\t100 XCTestCore 0x0000000102f14ad0 XCTAsyncEnumerateWithWaiter + 576\n\t101 XCTestCore 0x0000000102f14844 __72-[XCTExecutionWorker enqueueTestIdentifiersToRun:testIdentifiersToSkip:]_block_invoke + 136\n\t102 XCTestCore 0x0000000102f14db0 -[XCTExecutionWorker runWithError:] + 84\n\t103 XCTestCore 0x0000000102ef8f64 __25-[XCTestDriver _runTests]_block_invoke.332 + 56\n\t104 XCTestCore 0x0000000102f31684 -[XCTestObservationCenter _observeTestExecutionForTestBundle:inBlock:] + 212\n\t105 XCTestCore 0x0000000102ef8948 -[XCTestDriver _runTests] + 1160\n\t106 XCTestCore 0x0000000102f16330 _XCTestMain + 120\n\t107 WebDriverAgentRunner-Runner 0x0000000102801268 -[_XCTRunnerAppDelegate application:didFinishLaunchingWithOptions:] + 0\n\t108 WebDriverAgentRunner-Runner 0x0000000102801078 _XCTRunnerRunTests + 0\n\t109 CoreFoundation 0x00000001913a19b0 7821F73C-378B-3A10-BE90-EF526B7DBA93 + 444848\n\t110 CoreFoundation 0x0000000191344188 7821F73C-378B-3A10-BE90-EF526B7DBA93 + 61832\n\t111 CoreFoundation 0x000000019134509c 7821F73C-378B-3A10-BE90-EF526B7DBA93 + 65692\n\t112 CoreFoundation 0x0000000191346c3c CFRunLoopRunSpecific + 572\n\t113 GraphicsServices 0x00000001de525454 GSEventRunModal + 168\n\t114 UIKitCore 0x0000000193d59274 96636F64-106F-30C8-A780-82DCEBB0F443 + 1266292\n\t115 UIKitCore 0x0000000193d24a28 UIApplicationMain + 336\n\t116 WebDriverAgentRunner-Runner 0x00000001028014d8 main + 176\n\t117 dyld 0x00000001b821bf08 86D5253D-4FD1-36F3-B4AB-25982C90CBF4 + 257800\n)"
},
"sessionId" : "8EDB641E-B827-4E0E-8D0F-94631D03F076"
}
Environment:
- Platform: iOS
- WDA Version: 9.15.3
- iOS Version: iOS 18.5
- Device Model: iPhone 12 mini
Analysis/Possible Cause:
The error message Invalid parameter not satisfying: point.x != INFINITY && point.y != INFINITY indicates that during a drag operation, the coordinate values obtained by WDA or the underlying XCUITest framework became invalid (INFINITY, representing infinity).
This may occur under the following circumstances:
- UI State Invalidation: When switching from an app to the system home screen and then to another app, the WebDriverAgent may fail to correctly recapture or update the current app's UI context. This causes previously captured coordinate points to become unassociated or invalid within the new app environment.
- Coordinate System Issues: Differences in coordinate systems between applications or WDA's internal coordinate conversion mechanisms may fail after switching.
- WDA Cache/State Issues: WDA may not properly clear or reset internal state after switching applications, causing subsequent operations to be influenced by the previous application's context.
- XCUITest Framework Issues: This issue may also relate to the stability of Xcode/XCUITest framework itself during rapid app switching and UI automation operations.
Expected Resolution:
Fix the stability issue of the /wda/dragfromtoforduration interface during app switching scenarios. Ensure it correctly processes coordinates and executes drag operations even after the app context changes, preventing INFINITY errors.