google / EarlGrey

:tea: iOS UI Automation Test Framework
http://google.github.io/EarlGrey/
Apache License 2.0
5.61k stars 740 forks source link

EarlGrey 2.0 | EarlGrey hangs when attempting to clear a webview edit text #784

Open ElliottHeath opened 5 years ago

ElliottHeath commented 5 years ago

I'm currently performing a query with: EarlGrey.selectElement(with: grey_allOf([grey_accessibilityLabel("abcxyz"), grey_accessibilityTrait(UIAccessibilityTraits.staticText)])) .perform(grey_replaceText(textToType)) where the hierarchy dump shows a few items that match the AX.label and one that has the expected accessibility trait:

Partial (focused) hierarchy dump - | | | | | | | | |-- - | | | | | | | | | |-- - | | | | | | | | | | |-- - | | | | | | | | |-- - | | | | | | | | | |--

however, strangely enough, this hangs on a call in: + (void)grey_setText:(NSString *)text onWebElement:(id)element { [element accessibilityLabel], [element accessibilityLabel]]; - https://github.com/google/EarlGrey/blob/earlgrey2/AppFramework/Action/GREYActions.m#L471

From what I can tell, this is likely an EarlGrey issue. I verified I have the latest version of GreyActions.m released.

Full hierarchy dump > 2019-01-08 15:08:47.152440-0800 XyzUITests-Runner[9760:3820173] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform. 2019-01-08 15:08:48.258110-0800 XyzUITests-Runner[9760:3820173] [AXMediaCommon] Unable to look up screen scale 2019-01-08 15:08:48.258230-0800 XyzUITests-Runner[9760:3820173] [AXMediaCommon] Unexpected physical screen orientation 2019-01-08 15:08:48.309171-0800 XyzUITests-Runner[9760:3820173] [AXMediaCommon] Unable to look up screen scale 2019-01-08 15:08:48.313101-0800 XyzUITests-Runner[9760:3820173] [AXMediaCommon] Unable to look up screen scale 2019-01-08 15:08:48.313502-0800 XyzUITests-Runner[9760:3820173] [AXMediaCommon] Unexpected physical screen orientation 2019-01-08 15:08:48.456708-0800 XyzUITests-Runner[9760:3820173] Running tests... 2019-01-08 15:08:50.954248-0800 XyzUITests-Runner[9760:3820173] The EDOHostService (0x600000d0b420) is created and listening on 53277 Test Suite 'All tests' started at 2019-01-08 15:08:51.189 Test Suite 'XyzUITests.xctest' started at 2019-01-08 15:08:51.190 Test Suite 'DiscoverTest' started at 2019-01-08 15:08:51.190 Test Case '-[XyzUITests.DiscoverTest testDiscoverScreenElementPresence]' started. t = 0.00s Start Test at 2019-01-08 15:08:51.194 t = 0.03s Set Up t = 0.03s Open com.company.ZyXo t = 0.05s Launch com.company.ZyXo t = 6.44s Wait for com.company.ZyXo to idle t = 19.29s Waiting 5.0s for "abcxyz" TextField to exist t = 20.32s Checking `Expect predicate `exists == 1` for object "abcxyz" TextField` Found email: true t = 20.36s Find the "abcxyz" TextField t = 1024.55s Assertion Failure: Authentication.swift:59: Exception: com.google.earlgrey.ElementInteractionErrorDomain Exception Name: com.google.earlgrey.ElementInteractionErrorDomain Exception Reason: { "User Info" : { "NSLocalizedDescription" : "Interaction cannot continue because the desired element was not found." }, "Error Info" : { "Search API Info" : "", "Action Name" : "Replace with text: "abc123@gmail.com"", "Recovery Suggestion" : "Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches element.", "Element Matcher" : "((respondsToSelector(isAccessibilityElement) && isAccessibilityElement) && accessibilityHint('abcxyz'))" }, "Bundle ID" : "com.company.ZyXo", "File Name" : "GREYElementInteraction.m", "Stack Trace" : [ "0 AppFramework 0x000000010cae8198 -[GREYElementInteraction matchElementsWithTimeout:syncBeforeMatch:matchBlock:] + 3192", "1 AppFramework 0x000000010caea4a7 -[GREYElementInteraction performAction:error:] + 1975", "2 CoreFoundation 0x00000001105ce03c __invoking___ + 140", "3 CoreFoundation 0x00000001105cb4d5 -[NSInvocation invoke] + 325", "4 AppFramework 0x000000010cb1c3a9 __38+[EDOInvocationRequest requestHandler]_block_invoke + 4233", "5 AppFramework 0x000000010cb19341 -[EDOExecutor edo_handleRequest:withChannel:context:] + 337", "6 AppFramework 0x000000010cb18ef7 __50-[EDOExecutor receiveRequest:withChannel:context:]_block_invoke_2 + 55", "7 libdispatch.dylib 0x00000001137c34e1 _dispatch_call_block_and_release + 12", "8 libdispatch.dylib 0x00000001137c454b _dispatch_client_callout + 8", "9 libdispatch.dylib 0x00000001137cb01c _dispatch_lane_serial_drain + 720", "10 libdispatch.dylib 0x00000001137cbb5f _dispatch_lane_invoke + 401", "11 libdispatch.dylib 0x00000001137d49a8 _dispatch_workloop_worker_thread + 645", "12 libsystem_pthread.dylib 0x0000000113c45fd2 _pthread_wqthread + 980", "13 libsystem_pthread.dylib 0x0000000113c45be9 start_wqthread + 13" ], "Line" : "173", "Error Code" : "0", "Function Name" : "-[GREYElementInteraction matchElementsWithTimeout:syncBeforeMatch:matchBlock:]", "Description" : "Interaction cannot continue because the desired element was not found.", "Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain" } Exception Details: ((respondsToSelector(isAccessibilityElement) && isAccessibilityElement) && accessibilityHint('abcxyz')) Bundle ID: com.apple.test.XyzUITests-Runner Stack Trace: ( 0 XyzUITests 0x0000000126be028d -[GREYDefaultFailureHandler handleException:details:] + 1981 1 XyzUITests 0x0000000126bed951 -[GREYElementInteractionProxy grey_handleInteractionError:outError:] + 577 2 XyzUITests 0x0000000126bed076 -[GREYElementInteractionProxy performAction:error:] + 166 3 XyzUITests 0x0000000126becf7e -[GREYElementInteractionProxy performAction:] + 62 4 XyzUITests 0x0000000126bcd9b9 $SSo15GREYInteractionP21XyzUITestsE7performyxSo10GREYAction_pF + 73 5 XyzUITests 0x0000000126bc7f3b $SSo11XCUIElementC21XyzUITestsE9clearText04typeG0ySSSg_tF + 1051 6 XyzUITests 0x0000000126bc7747 $S21XyzUITests14AuthenticationC16authenticateUser11application15withCredentialsySo15XCUIApplicationC_AA0J0VtFZ + 1335 7 XyzUITests 0x0000000126bc6ae8 $S21XyzUITests12SigninScreenC0E10UserActionV21navigateToDestinationSbyF + 104 8 XyzUITests 0x0000000126bc6b19 $S21XyzUITests12SigninScreenC0E10UserActionVAA12TraverseEdgeA2aFP21navigateToDestinationSbyFTW + 9 9 XyzUITests 0x0000000126bc9ded $S21XyzUITests21DirectionalScreenEdgeC13executeActionSbyF + 141 10 XyzUITests 0x0000000126bd39cc $S21XyzUITests11ScreenGraphC010navigateToE007desiredE0SbAA0E0O_tF + 540 11 XyzUITests 0x0000000126bd5a71 $S21XyzUITests12DiscoverTestC5setUpyyF + 161 12 XyzUITests 0x0000000126bd5b04 $S21XyzUITests12DiscoverTestC5setUpyyFTo + 36 13 XyzUITests 0x0000000126bdd87e -[XCTestCase(GREYTest) grey_setUp] + 94 14 XCTest 0x0000000107912c74 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 57 15 XCTest 0x0000000107912b91 -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 96 16 XCTest 0x00000001078baf61 __24-[XCTestCase invokeTest]_block_invoke_3 + 89 17 XCTest 0x0000000107922d77 -[XCTContext _runActivityNamed:type:block:] + 245 18 XCTest 0x00000001078c37d6 -[XCTestCase startActivityWithTitle:type:block:] + 218 19 XCTest 0x00000001078c39b3 -[XCTestCase startActivityWithTitle:block:] + 60 20 XCTest 0x00000001078baadf __24-[XCTestCase invokeTest]_block_invoke + 342 21 XCTest 0x0000000107918b7e -[XCUITestContext performInScope:] + 248 22 XCTest 0x00000001078ba8ce -[XCTestCase testContextPerformInScope:] + 98 23 XCTest 0x00000001078ba97c -[XCTestCase invokeTest] + 137 24 XyzUITests 0x0000000126bdd366 -[XCTestCase(GREYTest) grey_invokeTest] + 1526 25 XCTest 0x00000001078bc4b7 __26-[XCTestCase performTest:]_block_invoke_2 + 43 26 XCTest 0x0000000107912c74 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 57 27 XCTest 0x0000000107912b91 -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 96 28 XCTest 0x00000001078bc3ce __26-[XCTestCase performTest:]_block_invoke.330 + 88 29 XCTest 0x000000010792344b +[XCTContext runInContextForTestCase:block:] + 225 30 XCTest 0x00000001078bbafd -[XCTestCase performTest:] + 675 31 XCTest 0x00000001078ff1a2 -[XCTest runTest] + 57 32 XCTest 0x00000001078b6ccb __27-[XCTestSuite performTest:]_block_invoke + 365 33 XCTest 0x00000001078b64a3 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 55 34 XCTest 0x00000001078b6766 -[XCTestSuite performTest:] + 296 35 XCTest 0x00000001078ff1a2 -[XCTest runTest] + 57 36 XCTest 0x00000001078b6ccb __27-[XCTestSuite performTest:]_block_invoke + 365 37 XCTest 0x00000001078b64a3 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 55 38 XCTest 0x00000001078b6766 -[XCTestSuite performTest:] + 296 39 XCTest 0x00000001078ff1a2 -[XCTest runTest] + 57 40 XCTest 0x00000001078b6ccb __27-[XCTestSuite performTest:]_block_invoke + 365 41 XCTest 0x00000001078b64a3 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 55 42 XCTest 0x00000001078b6766 -[XCTestSuite performTest:] + 296 43 XCTest 0x00000001078ff1a2 -[XCTest runTest] + 57 44 XCTest 0x000000010792ee86 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke + 171 45 XCTest 0x000000010792efa7 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke.80 + 68 46 XCTest 0x00000001078cebc1 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 585 47 XCTest 0x000000010792ebfa -[XCTTestRunSession runTestsAndReturnError:] + 623 48 XCTest 0x000000010789b6b6 -[XCTestDriver runTestsAndReturnError:] + 422 49 XCTest 0x000000010791f9cd _XCTestMain + 1478 50 XyzUITests-Runner 0x00000001075ba02d -[_XCTRunnerAppDelegate applicationWillResignActive:] + 0 51 XyzUITests-Runner 0x00000001075b9f2b _XCTRunnerRunTests + 0 52 CoreFoundation 0x0000000108a1c62c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12 53 CoreFoundation 0x0000000108a1bde0 __CFRunLoopDoBlocks + 336 54 CoreFoundation 0x0000000108a16654 __CFRunLoopRun + 1284 55 CoreFoundation 0x0000000108a15e11 CFRunLoopRunSpecific + 625 56 GraphicsServices 0x00000001110a31dd GSEventRunModal + 62 57 UIKitCore 0x0000000109a4a81d UIApplicationMain + 140 58 XyzUITests-Runner 0x00000001075ba1f5 main + 183 59 libdyld.dylib 0x000000010d5b1575 start + 1 60 ??? 0x0000000000000005 0x0 + 5 ) Screenshots: { "Screenshot At Failure" : "/Users/Elliott/Library/Developer/CoreSimulator/Devices/A39AECC3-B48C-4054-ABC5-47DF71D731EF/data/Containers/Data/Application/A13E52EA-61BA-4FED-B14C-CA4F43B77606/Documents/XyzUITests.DiscoverTest_testDiscoverScreenElementPresence-com.google.earlgrey.ElementInteractionErrorDomain-422C4C37-D185-4B62-BB2A-3716BE620693/XyzUITests.DiscoverTest_testDiscoverScreenElementPresence.png" } UI hierarchy (ordered by window level, front to back as rendered): Legend: { "[AX]" : "Accessibility", "[UIE]" : "User Interaction Enabled", "[Window 1]" : "Frontmost Window" } ========== Window 1 ========== |-- | |-- | | |--<_UINavigationBarModernPromptView:0x7fa199e443c0; AX=N; AX.frame={{0, 20}, {0, 0}}; AX.activationPoint={0, 20}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {0, 0}}; opaque; hidden; alpha=0> | | |--<_UINavigationBarContentView:0x7fa199e26960; AX=N; AX.frame={{0, 20}, {375, 44}}; AX.activationPoint={187.5, 42}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 44}}; opaque; alpha=1> | | | |-- | | | |--<_UIButtonBarButton:0x7fa199c67840; AX=Y; AX.label='Back'; AX.frame={{0, 20}, {65, 44}}; AX.activationPoint={32.5, 42}; AX.traits='UIAccessibilityTraitButton'; AX.focused='N'; frame={{0, 0}, {65, 44}}; opaque; alpha=1> | | | | |--<_UIBackButtonContainerView:0x7fa199c6c940; AX=N; AX.frame={{0, 20}, {65, 44}}; AX.activationPoint={32.5, 42}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {65, 44}}; opaque; alpha=1; UIE=N> | | | | | |--<_UIModernBarButton:0x7fa199e79f20; AX=Y; AX.label='Back'; AX.frame={{27, 29}, {38, 23.5}}; AX.activationPoint={46, 40.75}; AX.traits='UIAccessibilityTraitButton,UIAccessibilityTraitNotEnabled'; AX.focused='N'; frame={{27, 9}, {38, 23.5}}; alpha=1; UIE=N> | | | | | | |-- | | | | |--<_UIModernBarButton:0x7fa199c6ebd0; AX=Y; AX.frame={{8, 31.5}, {13, 21}}; AX.activationPoint={14.5, 42}; AX.traits='UIAccessibilityTraitButton,UIAccessibilityTraitNotEnabled'; AX.focused='N'; frame={{8, 11.5}, {13, 21}}; alpha=1; UIE=N> | | | | | |-- | | |--<_UINavigationBarLargeTitleView:0x7fa199e2ae90; AX=N; AX.frame={{0, 20}, {0, 0}}; AX.activationPoint={0, 20}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {0, 0}}; opaque; hidden; alpha=1> | | | |-- | | |--<_UIBarBackground:0x7fa199e1c100; AX=N; AX.frame={{0, 0}, {375, 64}}; AX.activationPoint={187.5, 32}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, -20}, {375, 64}}; opaque; alpha=1; UIE=N> | | | |-- | | |-- | | |-- | |-- | | |--<_UIToolbarContentView:0x7fa199d63800; AX=N; AX.frame={{0, 667}, {375, 44}}; AX.activationPoint={187.5, 689}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 44}}; opaque; alpha=1> | | | |--<_UIButtonBarStackView:0x7fa199d645a0; AX=N; AX.frame={{0, 667}, {375, 44}}; AX.activationPoint={187.5, 689}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 44}}; opaque; alpha=1> | | |--<_UIBarBackground:0x7fa199d61d80; AX=N; AX.frame={{0, 667}, {375, 44}}; AX.activationPoint={187.5, 689}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 44}}; opaque; alpha=1; UIE=N> | | | |-- | | | | |--<_UIVisualEffectSubview:0x7fa199d630a0; AX=N; AX.frame={{0, 667}, {375, 44}}; AX.activationPoint={187.5, 689}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 44}}; opaque; alpha=1; UIE=N> | | | | |--<_UIVisualEffectBackdropView:0x7fa199d62b60; AX=N; AX.frame={{0, 667}, {375, 44}}; AX.activationPoint={187.5, 689}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 44}}; opaque; alpha=1; UIE=N> | | | |-- | |-- | | |-- | | | |-- | | | | |-- | | | | | |-- | | | | | | |-- | | | | | | | |-- | | | | | |--<_UIWebViewScrollView:0x7fa19a0c7000; AX=N; AX.frame={{0, 64}, {375, 603}}; AX.activationPoint={187.5, 365.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 603}}; opaque; alpha=1> | | | | | | |-- | | | | | | |-- | | | | | | |-- | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | |-- | | | | | | | | | |-- | | | | | | | | | | |-- ========== Window 2 ========== t = 1024.82s Assertion Failure: XCTestCase+GREYTest.m:115: failed: caught "EarlGreyInternalTestInterruptException", "Immediately halt execution of testcase" ( 0 CoreFoundation 0x0000000108ab71bb __exceptionPreprocess + 331 1 libobjc.A.dylib 0x0000000108055735 objc_exception_throw + 48 2 CoreFoundation 0x0000000108ab6d29 -[NSException raise] + 9 3 XyzUITests 0x0000000126bdcb7a -[XCTestCase(GREYTest) grey_markAsFailedAtLine:inFile:description:] + 186 4 XyzUITests 0x0000000126be03ec -[GREYDefaultFailureHandler handleException:details:] + 2332 5 XyzUITests 0x0000000126bed951 -[GREYElementInteractionProxy grey_handleInteractionError:outError:] + 577 6 XyzUITests 0x0000000126bed076 -[GREYElementInteractionProxy performAction:error:] + 166 7 XyzUITests 0x0000000126becf7e -[GREYElementInteractionProxy performAction:] + 62 8 XyzUITests 0x0000000126bcd9b9 $SSo15GREYInteractionP21XyzUITestsE7performyxSo10GREYAction_pF + 73 9 XyzUITests 0x0000000126bc7f3b $SSo11XCUIElementC21XyzUITestsE9clearText04typeG0ySSSg_tF + 1051 10 XyzUITests 0x0000000126bc7747 $S21XyzUITests14AuthenticationC16authenticateUser11application15withCredentialsySo15XCUIApplicationC_AA0J0VtFZ + 1335 11 XyzUITests 0x0000000126bc6ae8 $S21XyzUITests12SigninScreenC0E10UserActionV21navigateToDestinationSbyF + 104 12 XyzUITests 0x0000000126bc6b19 $S21XyzUITests12SigninScreenC0E10UserActionVAA12TraverseEdgeA2aFP21navigateToDestinationSbyFTW + 9 13 XyzUITests 0x0000000126bc9ded $S21XyzUITests21DirectionalScreenEdgeC13executeActionSbyF + 141 14 XyzUITests 0x0000000126bd39cc $S21XyzUITests11ScreenGraphC010navigateToE007desiredE0SbAA0E0O_tF + 540 15 XyzUITests 0x0000000126bd5a71 $S21XyzUITests12DiscoverTestC5setUpyyF + 161 16 XyzUITests 0x0000000126bd5b04 $S21XyzUITests12DiscoverTestC5setUpyyFTo + 36 17 XyzUITests 0x0000000126bdd87e -[XCTestCase(GREYTest) grey_setUp] + 94 18 XCTest 0x0000000107912c74 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 57 19 XCTest 0x0000000107912b91 -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 96 20 XCTest 0x00000001078baf61 __24-[XCTestCase invokeTest]_block_invoke_3 + 89 21 XCTest 0x0000000107922d77 -[XCTContext _runActivityNamed:type:block:] + 245 22 XCTest 0x00000001078c37d6 -[XCTestCase startActivityWithTitle:type:block:] + 218 23 XCTest 0x00000001078c39b3 -[XCTestCase startActivityWithTitle:block:] + 60 24 XCTest 0x00000001078baadf __24-[XCTestCase invokeTest]_block_invoke + 342 25 XCTest 0x0000000107918b7e -[XCUITestContext performInScope:] + 248 26 XCTest 0x00000001078ba8ce -[XCTestCase testContextPerformInScope:] + 98 27 XCTest 0x00000001078ba97c -[XCTestCase invokeTest] + 137 28 XyzUITests 0x0000000126bdd366 -[XCTestCase(GREYTest) grey_invokeTest] + 1526 29 XCTest 0x00000001078bc4b7 __26-[XCTestCase performTest:]_block_invoke_2 + 43 30 XCTest 0x0000000107912c74 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 57 31 XCTest 0x0000000107912b91 -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 96 32 XCTest 0x00000001078bc3ce __26-[XCTestCase performTest:]_block_invoke.330 + 88 33 XCTest 0x000000010792344b +[XCTContext runInContextForTestCase:block:] + 225 34 XCTest 0x00000001078bbafd -[XCTestCase performTest:] + 675 35 XCTest 0x00000001078ff1a2 -[XCTest runTest] + 57 36 XCTest 0x00000001078b6ccb __27-[XCTestSuite performTest:]_block_invoke + 365 37 XCTest 0x00000001078b64a3 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 55 38 XCTest 0x00000001078b6766 -[XCTestSuite performTest:] + 296 39 XCTest 0x00000001078ff1a2 -[XCTest runTest] + 57 40 XCTest 0x00000001078b6ccb __27-[XCTestSuite performTest:]_block_invoke + 365 41 XCTest 0x00000001078b64a3 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 55 42 XCTest 0x00000001078b6766 -[XCTestSuite performTest:] + 296 43 XCTest 0x00000001078ff1a2 -[XCTest runTest] + 57 44 XCTest 0x00000001078b6ccb __27-[XCTestSuite performTest:]_block_invoke + 365 45 XCTest 0x00000001078b64a3 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 55 46 XCTest 0x00000001078b6766 -[XCTestSuite performTest:] + 296 47 XCTest 0x00000001078ff1a2 -[XCTest runTest] + 57 48 XCTest 0x000000010792ee86 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke + 171 49 XCTest 0x000000010792efa7 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke.80 + 68 50 XCTest 0x00000001078cebc1 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 585 51 XCTest 0x000000010792ebfa -[XCTTestRunSession runTestsAndReturnError:] + 623 52 XCTest 0x000000010789b6b6 -[XCTestDriver runTestsAndReturnError:] + 422 53 XCTest 0x000000010791f9cd _XCTestMain + 1478 54 XyzUITests-Runner 0x00000001075ba02d -[_XCTRunnerAppDelegate applicationWillResignActive:] + 0 55 XyzUITests-Runner 0x00000001075b9f2b _XCTRunnerRunTests + 0 56 CoreFoundation 0x0000000108a1c62c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12 57 CoreFoundation 0x0000000108a1bde0 __CFRunLoopDoBlocks + 336 58 CoreFoundation 0x0000000108a16654 __CFRunLoopRun + 1284 59 CoreFoundation 0x0000000108a15e11 CFRunLoopRunSpecific + 625 60 GraphicsServices 0x00000001110a31dd GSEventRunModal + 62 61 UIKitCore 0x0000000109a4a81d UIApplicationMain + 140 62 XyzUITests-Runner 0x00000001075ba1f5 main + 183 63 libdyld.dylib 0x000000010d5b1575 start + 1 64 ??? 0x0000000000000005 0x0 + 5 )

It's also worth noting that the same issue happens when using both clearText and replaceText.

The error message seen on the right side of the screen in xcode from the last run is: Thread 45: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

tirodkar commented 5 years ago

Change the accessibility_hint to accessibility_label. There's no element in the hierarchy with that value.

ElliottHeath commented 5 years ago

Sorry, label's actually what I started with. I also tried with hint as well (as seen in the full hierarchical dump) to ensure I wasn't using the wrong thing since I hadn't worked with accessibility labels/hints before. Since labels finds the elements, but hangs when trying to set the text, I can't actually get a dump with the labels code. Let me know if there's anything else I can provide that will help. Adding a screenshot of the call stack that opens when the hang occurs.

settext hang stack
tirodkar commented 5 years ago

What type of WebView is this? UI or WK?

ElliottHeath commented 5 years ago

Based on the hierarchy dump, it's a UIWebView. ie. | | | | |--<UIWebView:0x7fa199c59310; AX=N; AX.id='AuthPortalWebView'; AX.frame={{0, 64}, {375, 603}}; AX.activationPoint={187.5, 365.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 603}}; opaque; alpha=1>