EarlGrey icon indicating copy to clipboard operation
EarlGrey copied to clipboard

Not able to select an UITabBarButton in iOS 13

Open ghost opened this issue 6 years ago • 15 comments

The function I used to select a tab in iOS < 13 looks like this:

EarlGrey.selectElement(with: grey_text(tabTitle)).inRoot(grey_kindOfClass(UITabBar.self)).perform(grey_tap())

This stopped working, probably due to the new view hierarchy. Did anyone find a way around it?

ghost avatar Sep 16 '19 09:09 ghost

Can you print the error please?

tirodkar avatar Sep 16 '19 14:09 tirodkar

That's Xcode output:

Exception Name: TimeoutException
Exception Reason: Timed out while waiting to perform action.
Exception with Action: {
  "Action Name":  "Tap",
  "Element Matcher":  "((kindOfClass('UILabel') || kindOfClass('UITextField') || kindOfClass('UITextView')) && hasText('MEIN PROFIL'))"
}

Exception Details: Error Trace: [
  {
    "Description":  "Failed to execute block because idling resources below are busy.",
    "Description Glossary":    {
      "GREYAppStateTracker":  "Waiting for viewDidAppear: call on the view controller. Please ensure that this view controller and its subclasses call through to their super's implementation.

Full state transition call stack for all objects:
<UIEditingOverlayViewController:0x7ff2e842c650> => Waiting for viewDidAppear: call on the view controller. Please ensure that this view controller and its subclasses call through to their super's implementation.
(
	0   EarlGrey                            0x000000010b5b018e -[GREYAppStateTrackerObject setState:] + 62
	1   EarlGrey                            0x000000010b557699 __133-[GREYAppStateTracker grey_changeState:usingOperation:forObject:orInternalObjectDeallocationTracker:orExternalAppStateTrackerObject:]_block_invoke + 1161
	2   EarlGrey                            0x000000010b55684d -[GREYAppStateTracker grey_performBlockInCriticalSection:] + 333
	3   EarlGrey                            0x000000010b5570be -[GREYAppStateTracker grey_changeState:usingOperation:forObject:orInternalObjectDeallocationTracker:orExternalAppStateTrackerObject:] + 1390
	4   EarlGrey                            0x000000010b55516f -[GREYAppStateTracker trackState:forObject:] + 95
	5   EarlGrey                            0x000000010b55bb1f -[UIViewController(GREYAdditions) greyswizzled_viewWillAppear:] + 719
	6   UIKitCore                           0x00007fff46b03591 -[UIViewController _setViewAppearState:isAnimating:] + 661
	7   UIKitCore                           0x00007fff46b03cad -[UIViewController __viewWillAppear:] + 115
	8   UIKitCore                           0x00007fff46b04d82 -[UIViewController viewWillMoveToWindow:] + 654
	9   EarlGrey                            0x000000010b55b608 -[UIViewController(GREYAdditions) greyswizzled_viewWillMoveToWindow:] + 344
	10  UIKitCore                           0x00007fff4761f290 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 639
	11  UIKitCore                           0x00007fff4762f647 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 440
	12  EarlGrey                            0x000000010b58f90a -[UIView(GREYAdditions) greyswizzled_addSubview:] + 90
	13  UIKitCore                           0x00007fff46f40bf7 -[UIInputWindowController presentViewController:] + 295
	14  UIKitCore                           0x00007fff4743980e -[UITextEffectsWindow _commonInitWithOptions:] + 541
	15  UIKitCore                           0x00007fff474393f3 -[UITextEffectsWindow(UIObjectsForPerCanvas) _initWithCanvas:options:] + 316
	16  UIKitCore                           0x00007fff474ef615 +[_UIObjectPerCanvas objectOfClass:forCanvas:withOptions:createIfNecessary:] + 1057
	17  UIKitCore                           0x00007fff4743b2e4 +[UITextEffectsWindow _sharedTextEffectsWindowforWindowScene:allowHosted:matchesStatusBarOrientationOnAccess:shouldCreateIfNecessary:] + 1446
	18  UIKitCore                           0x00007fff4743b42d +[UITextEffectsWindow sharedTextEffectsWindowForWindowScene:] + 152
	19  UIKitCore                           0x00007fff46c3b659 -[UIInputResponderController containerWindow] + 152
	20  UIKitCore                           0x00007fff46c3b777 -[UIInputResponderController containerRootController] + 24
	21  UIKitCore                           0x00007fff46fc77a7 __43-[_UIRemoteKeyboards reloadForSnapshotting]_block_invoke + 32
	22  UIKitCore                           0x00007fff46c3b4f9 +[UIInputResponderController performOnControllers:] + 574
	23  UIKitCore                           0x00007fff46fc810f __33-[_UIRemoteKeyboards willResume:]_block_invoke + 95
	24  libdispatch.dylib                   0x00007fff511fc7f9 _dispatch_client_callout + 8
	25  libdispatch.dylib                   0x00007fff511ff211 _dispatch_block_invoke_direct + 285
	26  FrontBoardServices                  0x00007fff3633108a __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
	27  FrontBoardServices                  0x00007fff36330d78 -[FBSSerialQueue _queue_performNextIfPossible] + 441
	28  FrontBoardServices                  0x00007fff36331287 -[FBSSerialQueue _performNextFromRunLoopSource] + 22
	29  CoreFoundation                      0x00007fff23afbac1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	30  CoreFoundation                      0x00007fff23afb9ec __CFRunLoopDoSource0 + 76
	31  CoreFoundation                      0x00007fff23afb1c4 __CFRunLoopDoSources0 + 180
	32  CoreFoundation                      0x00007fff23af5ecf __CFRunLoopRun + 1263
	33  CoreFoundation                      0x00007fff23af56b6 CFRunLoopRunSpecific + 438
	34  EarlGrey                            0x000000010b5953d6 -[GREYRunLoopSpinner grey_drainRunLoopInActiveModeForDrains:] + 326
	35  EarlGrey                            0x000000010b595112 -[GREYRunLoopSpinner spinWithStopConditionBlock:] + 402
	36  EarlGrey                            0x000000010b5e4e27 -[GREYUIThreadExecutor executeSyncWithTimeout:block:error:] + 1415
	37  EarlGrey                            0x000000010b5b30d2 -[GREYElementInteraction performAction:error:] + 2290
	38  EarlGrey                            0x000000010b5b278e -[GREYElementInteraction performAction:] + 62
	39  ClunoFunctionalTests                0x000000010dc28629 $sSo15GREYInteractionP20ClunoFunctionalTestsE7performyxSo10GREYAction_pSgF + 265
	40  ClunoFunctionalTests                0x000000010dc0fb1f $s20ClunoFunctionalTestsAAC3tab2atySi_tFZ + 415
	41  ClunoFunctionalTests                0x000000010dc21e52 $s20ClunoFunctionalTestsAAC23provideLoginCredentialsyyF + 82
	42  ClunoFunctionalTests                0x000000010dc2281b $s20ClunoFunctionalTestsAAC23provideLoginCredentialsyyFTo + 43
	43  ClunoFunctionalTests                0x000000010dc0e4fb $s20ClunoFunctionalTestsAAC17testAlterPasswordyyF + 59
	44  ClunoFunctionalTests                0x000000010dc0fb8b $s20ClunoFunctionalTestsAAC17testAlterPasswordyyFTo + 43
	45  CoreFoundation                      0x00007fff23b9f95c __invoking___ + 140
	46  CoreFoundation                      0x00007fff23b9cd8f -[NSInvocation invoke] + 287
	47  EarlGrey                            0x000000010b5aa640 -[GREYTestCaseInvocation invoke] + 112
	48  XCTest                              0x000000010d8d5121 __24-[XCTestCase invokeTest]_block_invoke.208 + 78
	49  XCTest                              0x000000010d92f1e2 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 57
	50  XCTest                              0x000000010d92f100 -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 96
	51  XCTest                              0x000000010d8d4c0a __24-[XCTestCase invokeTest]_block_invoke + 1153
	52  XCTest                              0x000000010d8d46e2 -[XCTestCase testContextPerformInScope:] + 211
	53  XCTest                              0x000000010d8d477c -[XCTestCase invokeTest] + 137
	54  EarlGrey                            0x000000010b59d2a8 -[XCTestCase(GREYAdditions) grey_invokeTest] + 1576
	55  XCTest                              0x000000010d8d64ed __26-[XCTestCase performTest:]_block_invoke_2 + 43
	56  XCTest                              0x000000010d92f1e2 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 57
	57  XCTest                              0x000000010d92f100 -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 96
	58  XCTest                              0x000000010d8d6404 __26-[XCTestCase performTest:]_block_invoke.334 + 88
	59  XCTest                              0x000000010d942492 +[XCTContext runInContextForTestCase:block:] + 219
	60  XCTest                              0x000000010d8d5b73 -[XCTestCase performTest:] + 668
	61  XCTest                              0x000000010d91b077 -[XCTest runTest] + 57
	62  XCTest                              0x000000010d8d014a __27-[XCTestSuite performTest:]_block_invoke + 365
	63  XCTest                              0x000000010d8cf874 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 54
	64  XCTest                              0x000000010d8cfb71 -[XCTestSuite performTest:] + 355
	65  XCTest                              0x000000010d91b077 -[XCTest runTest] + 57
	66  XCTest                              0x000000010d8d014a __27-[XCTestSuite performTest:]_block_invoke + 365
	67  XCTest                              0x000000010d8cf874 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 54
	68  XCTest                              0x000000010d8cfb71 -[XCTestSuite performTest:] + 355
	69  XCTest                              0x000000010d91b077 -[XCTest runTest] + 57
	70  XCTest                              0x000000010d8d014a __27-[XCTestSuite performTest:]_block_invoke + 365
	71  XCTest                              0x000000010d8cf874 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 54
	72  XCTest                              0x000000010d8cfb71 -[XCTestSuite performTest:] + 355
	73  XCTest                              0x000000010d91b077 -[XCTest runTest] + 57
	74  XCTest                              0x000000010d95143e __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke + 171
	75  XCTest                              0x000000010d951541 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke.84 + 118
	76  XCTest                              0x000000010d8e9e83 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 588
	77  XCTest                              0x000000010d9511fd -[XCTTestRunSession runTestsAndReturnError:] + 623
	78  XCTest                              0x000000010d8b36d7 -[XCTestDriver runTestsAndReturnError:] + 456
	79  XCTest                              0x000000010d93e6e4 _XCTestMain + 2484
	80  libXCTestBundleInject.dylib         0x000000010b6bebe7 __copy_helper_block_e8_32s + 0
	81  CoreFoundation                      0x00007fff23afb8ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
	82  CoreFoundation                      0x00007fff23afb058 __CFRunLoopDoBlocks + 312
	83  CoreFoundation                      0x00007fff23af5ee4 __CFRunLoopRun + 1284
	84  CoreFoundation                      0x00007fff23af56b6 CFRunLoopRunSpecific + 438
	85  GraphicsServices                    0x00007fff3815cbb0 GSEventRunModal + 65
	86  UIKitCore                           0x00007fff47162a67 UIApplicationMain + 1621
	87  Cluno                               0x000000010a1ad20b main + 75
	88  libdyld.dylib                       0x00007fff5123bcf5 start + 1
)
"
    },
    "Error Domain":  "com.google.earlgrey.GREYUIThreadExecutorErrorDomain",
    "Error Code":  "0",
    "File Name":  "GREYUIThreadExecutor.m",
    "Function Name":  "-[GREYUIThreadExecutor executeSyncWithTimeout:block:error:]",
    "Line":  "239",
    "TestCase Class":  "ClunoFunctionalTests.ClunoFunctionalTests",
    "TestCase Method":  "testAlterPassword"
  },
  {
    "Description":  "Failed to perform action within 30 seconds.",
    "Error Domain":  "com.google.earlgrey.ElementInteractionErrorDomain",
    "Error Code":  "4",
    "File Name":  "GREYElementInteraction.m",
    "Function Name":  "-[GREYElementInteraction performAction:error:]",
    "Line":  "303",
    "TestCase Class":  "ClunoFunctionalTests.ClunoFunctionalTests",
    "TestCase Method":  "testAlterPassword"
  }
]

There are 2 windows being rendered:

UI hierarchy (ordered by window level, front to back as rendered):

Legend: {
  "[AX]":  "Accessibility",
  "[UIE]":  "User Interaction Enabled",
  "[Window 1]":  "Frontmost Window"
}

========== Window 1 ==========

<UITextEffectsWindow:0x7ff2e8550a60; AX=N; AX.frame={{0, 0}, {414, 896}}; AX.activationPoint={207, 448}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {414, 896}}; alpha=1>
  |--<UIInputSetContainerView:0x7ff2e841f850; AX=N; AX.frame={{0, 0}, {414, 896}}; AX.activationPoint={207, 448}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {414, 896}}; opaque; alpha=1>
  |  |--<UIEditingOverlayGestureView:0x7ff2e842cbc0; AX=N; AX.frame={{0, 0}, {414, 896}}; AX.activationPoint={207, 448}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {414, 896}}; opaque; alpha=1>
  |  |--<UIInputSetHostView:0x7ff2e8413ae0; AX=N; AX.frame={{0, 896}, {414, 0}}; AX.activationPoint={207, 896}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 896}, {414, 0}}; opaque; alpha=1>

========== Window 2 ==========

<Cluno.Window:0x7ff2e85150e0; AX=N; AX.frame={{0, 0}, {414, 896}}; AX.activationPoint={207, 448}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {414, 896}}; opaque; alpha=1>
  |--<UITransitionView:0x7ff2e8624550; AX=N; AX.frame={{0, 0}, {414, 896}}; AX.activationPoint={207, 448}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {414, 896}}; opaque; alpha=1>
  |  |--<UIDropShadowView:0x7ff2e872f900; AX=N; AX.frame={{0, 0}, {414, 896}}; AX.activationPoint={207, 448}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {414, 896}}; opaque; alpha=1>
  |  |  |--<UILayoutContainerView:0x7ff2eae01ed0; AX=N; AX.frame={{0, 0}, {414, 896}}; AX.activationPoint={207, 448}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {414, 896}}; opaque; alpha=1>
  |  |  |  |--<UITabBar:0x7ff2e8411990; AX=N; AX.frame={{0, 813}, {414, 83}}; AX.activationPoint={207, 854.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 813}, {414, 83}}; opaque; alpha=1>

...


Window 2 is where I have all my views (and the tabBar I want to access).

ghost avatar Sep 16 '19 15:09 ghost

We don't have any specific tests for UITabBar. I can add one and check with EarlGrey 2.0.

tirodkar avatar Sep 16 '19 15:09 tirodkar

@tirodkar i am seeing the same issue on iOS 13.1 for a button click :(

    func testBasicSelection() {
        EarlGrey.selectElement(with: grey_text("Login")).perform(grey_tap())
    }

badrinathvm avatar Nov 04 '19 19:11 badrinathvm

Exception: ``` Exception: TimeoutException

Exception Name: TimeoutException Exception Reason: Timed out while waiting to perform action. Exception with Action: { "Action Name": "Tap", "Element Matcher": "((kindOfClass('UILabel') || kindOfClass('UITextField') || kindOfClass('UITextView')) && hasText('E2E Login'))" }

Exception Details: Error Trace: [ { "Description": "Failed to execute block because idling resources below are busy.", "Description Glossary": { "GREYAppStateTracker": "Waiting for viewDidAppear: call on the view controller. Please ensure that this view controller and its subclasses call through to their super's implementation.

Full state transition call stack for all objects: UIEditingOverlayViewController:0x7fb4efe305b0 => Waiting for viewDidAppear: call on the view controller. Please ensure that this view controller and its subclasses call through to their super's implementation. ( 0 EarlGrey 0x0000000104e7b18e -[GREYAppStateTrackerObject setState:] + 62 1 EarlGrey 0x0000000104e22699 __133-[GREYAppStateTracker grey_changeState:usingOperation:forObject:orInternalObjectDeallocationTracker:orExternalAppStateTrackerObject:]_block_invoke + 1161 2 EarlGrey 0x0000000104e2184d -[GREYAppStateTracker grey_performBlockInCriticalSection:] + 333 3 EarlGrey 0x0000000104e220be -[GREYAppStateTracker grey_changeState:usingOperation:forObject:orInternalObjectDeallocationTracker:orExternalAppStateTrackerObject:] + 1390 4 EarlGrey 0x0000000104e2016f -[GREYAppStateTracker trackState:forObject:] + 95 5 EarlGrey 0x0000000104e26b1f -[UIViewController(GREYAdditions) greyswizzled_viewWillAppear:] + 719 6 UIKitCore 0x00007fff46f0ebd5 -[UIViewController _setViewAppearState:isAnimating:] + 661 7 UIKitCore 0x00007fff46f0f2f1 -[UIViewController __viewWillAppear:] + 115 8 UIKitCore 0x00007fff46f103c6 -[UIViewController viewWillMoveToWindow:] + 654 9 EarlGrey 0x0000000104e26608 -[UIViewController(GREYAdditions) greyswizzled_viewWillMoveToWindow:] + 344 10 UIKitCore 0x00007fff47a3b484 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 639 11 UIKitCore 0x00007fff47a4b8c0 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 440 12 EarlGrey 0x0000000104e5a90a -[UIView(GREYAdditions) greyswizzled_addSubview:] + 90 13 UIKitCore 0x00007fff47350476 -[UIInputWindowController presentViewController:] + 295 14 UIKitCore 0x00007fff47852803 -[UITextEffectsWindow _commonInitWithOptions:] + 654 15 UIKitCore 0x00007fff47852377 -[UITextEffectsWindow(UIObjectsForPerCanvas) _initWithCanvas:options:] + 316 16 UIKitCore 0x00007fff4790914d +[_UIObjectPerCanvas objectOfClass:forCanvas:withOptions:createIfNecessary:] + 1057 17 UIKitCore 0x00007fff4785432c +[UITextEffectsWindow _sharedTextEffectsWindowforWindowScene:allowHosted:matchesStatusBarOrientationOnAccess:shouldCreateIfNecessary:] + 1446 18 UIKitCore 0x00007fff47854475 +[UITextEffectsWindow sharedTextEffectsWindowForWindowScene:] + 152 19 UIKitCore 0x00007fff47047d28 -[UIInputResponderController containerWindow] + 152 20 UIKitCore 0x00007fff47047e46 -[UIInputResponderController containerRootController] + 24 21 UIKitCore 0x00007fff473d8664 __43-[_UIRemoteKeyboards reloadForSnapshotting]_block_invoke + 32 22 UIKitCore 0x00007fff47047bc8 +[UIInputResponderController performOnControllers:] + 574 23 UIKitCore 0x00007fff473d8fcc __33-[_UIRemoteKeyboards willResume:]_block_invoke + 95 24 libdispatch.dylib 0x00007fff516ad781 _dispatch_client_callout + 8 25 libdispatch.dylib 0x00007fff516b0199 _dispatch_block_invoke_direct + 285 26 FrontBoardServices 0x00007fff3652c49e FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 30 27 FrontBoardServices 0x00007fff3652c18c -[FBSSerialQueue _queue_performNextIfPossible] + 441 28 FrontBoardServices 0x00007fff3652c69b -[FBSSerialQueue _performNextFromRunLoopSource] + 22 29 CoreFoundation 0x00007fff23b0d271 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 30 CoreFoundation 0x00007fff23b0d19c __CFRunLoopDoSource0 + 76 31 CoreFoundation 0x00007fff23b0c974 __CFRunLoopDoSources0 + 180 32 CoreFoundation 0x00007fff23b0767f _CFRunLoopRun + 1263 33 CoreFoundation 0x00007fff23b06e66 CFRunLoopRunSpecific + 438 34 EarlGrey 0x0000000104e603d6 -[GREYRunLoopSpinner grey_drainRunLoopInActiveModeForDrains:] + 326 35 EarlGrey 0x0000000104e60112 -[GREYRunLoopSpinner spinWithStopConditionBlock:] + 402 36 EarlGrey 0x0000000104eafe27 -[GREYUIThreadExecutor executeSyncWithTimeout:block:error:] + 1415 37 EarlGrey 0x0000000104e7e0d2 -[GREYElementInteraction performAction:error:] + 2290 38 EarlGrey 0x0000000104e7d78e -[GREYElementInteraction performAction:] + 62 39 bup-sample-iosUITests 0x000000010beecc2d $sSo15GREYInteractionP21bup_sample_iosUITestsE7performyxSo10GREYAction_pSgF + 285 40 bup-sample-iosUITests 0x000000010bee63f9 $s21bup_sample_iosUITestsAAC18testBasicSelectionyyF + 297 41 bup-sample-iosUITests 0x000000010bee644b $s21bup_sample_iosUITestsAAC18testBasicSelectionyyFTo + 43 42 CoreFoundation 0x00007fff23bb138c invoking + 140 43 CoreFoundation 0x00007fff23bae49f -[NSInvocation invoke] + 319 44 EarlGrey 0x0000000104e75640 -[GREYTestCaseInvocation invoke] + 112 45 XCTest 0x000000010bbcb121 __24-[XCTestCase invokeTest]_block_invoke.208 + 78 46 XCTest 0x000000010bc251e2 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 57 47 XCTest 0x000000010bc25100 -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 96 48 XCTest 0x000000010bbcac0a __24-[XCTestCase invokeTest]_block_invoke + 1153 49 XCTest 0x000000010bbca6e2 -[XCTestCase testContextPerformInScope:] + 211 50 XCTest 0x000000010bbca77c -[XCTestCase invokeTest] + 137 51 EarlGrey 0x0000000104e682a8 -[XCTestCase(GREYAdditions) grey_invokeTest] + 1576 52 XCTest 0x000000010bbcc4ed __26-[XCTestCase performTest:]_block_invoke_2 + 43 53 XCTest 0x000000010bc251e2 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 57 54 XCTest 0x000000010bc25100 -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 96 55 XCTest 0x000000010bbcc404 __26-[XCTestCase performTest:]_block_invoke.334 + 88 56 XCTest 0x000000010bc38492 +[XCTContext runInContextForTestCase:block:] + 219 57 XCTest 0x000000010bbcbb73 -[XCTestCase performTest:] + 668 58 XCTest 0x000000010bc11077 -[XCTest runTest] + 57 59 XCTest 0x000000010bbc614a __27-[XCTestSuite performTest:]_block_invoke + 365 60 XCTest 0x000000010bbc5874 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 54 61 XCTest 0x000000010bbc5b71 -[XCTestSuite performTest:] + 355 62 XCTest 0x000000010bc11077 -[XCTest runTest] + 57 63 XCTest 0x000000010bbc614a __27-[XCTestSuite performTest:]_block_invoke + 365 64 XCTest 0x000000010bbc5874 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 54 65 XCTest 0x000000010bbc5b71 -[XCTestSuite performTest:] + 355 66 XCTest 0x000000010bc11077 -[XCTest runTest] + 57 67 XCTest 0x000000010bbc614a __27-[XCTestSuite performTest:]_block_invoke + 365 68 XCTest 0x000000010bbc5874 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 54 69 XCTest 0x000000010bbc5b71 -[XCTestSuite performTest:] + 355 70 XCTest 0x000000010bc11077 -[XCTest runTest] + 57 71 XCTest 0x000000010bc4743e __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke + 171 72 XCTest 0x000000010bc47541 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke.84 + 118 73 XCTest 0x000000010bbdfe83 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 588 74 XCTest 0x000000010bc471fd -[XCTTestRunSession runTestsAndReturnError:] + 623 75 XCTest 0x000000010bba96d7 -[XCTestDriver runTestsAndReturnError:] + 456 76 XCTest 0x000000010bc346e4 _XCTestMain + 2484 77 libXCTestBundleInject.dylib 0x0000000104f89be7 __copy_helper_block_e8_32s + 0 78 CoreFoundation 0x00007fff23b0d09c CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 79 CoreFoundation 0x00007fff23b0c808 __CFRunLoopDoBlocks + 312 80 CoreFoundation 0x00007fff23b07694 __CFRunLoopRun + 1284 81 CoreFoundation 0x00007fff23b06e66 CFRunLoopRunSpecific + 438 82 GraphicsServices 0x00007fff38346bb0 GSEventRunModal + 65 83 UIKitCore 0x00007fff47578dd0 UIApplicationMain + 1621 84 bup-sample-ios 0x0000000104c433ab main + 75 85 libdyld.dylib 0x00007fff516ecd29 start + 1 86 ??? 0x0000000000000005 0x0 + 5 ) " }, "Error Domain": "com.google.earlgrey.GREYUIThreadExecutorErrorDomain", "Error Code": "0", "File Name": "GREYUIThreadExecutor.m", "Function Name": "-[GREYUIThreadExecutor executeSyncWithTimeout:block:error:]", "Line": "239", "TestCase Class": "bup_sample_iosUITests.bup_sample_iosUITests", "TestCase Method": "testBasicSelection" }, { "Description": "Failed to perform action within 30 seconds.", "Error Domain": "com.google.earlgrey.ElementInteractionErrorDomain", "Error Code": "4", "File Name": "GREYElementInteraction.m", "Function Name": "-[GREYElementInteraction performAction:error:]", "Line": "303", "TestCase Class": "bup_sample_iosUITests.bup_sample_iosUITests", "TestCase Method": "testBasicSelection" } ]

Bundle ID: com.intuit.bup-sample-ios

Stack Trace: ( 0 EarlGrey 0x0000000104ea128d -[GREYDefaultFailureHandler handleException:details:] + 1981 1 EarlGrey 0x0000000104e830c6 -[GREYElementInteraction grey_handleFailureOfAction:actionError:userProvidedOutError:] + 4102 2 EarlGrey 0x0000000104e7e5fe -[GREYElementInteraction performAction:error:] + 3614 3 EarlGrey 0x0000000104e7d78e -[GREYElementInteraction performAction:] + 62 4 bup-sample-iosUITests 0x000000010beecc2d $sSo15GREYInteractionP21bup_sample_iosUITestsE7performyxSo10GREYAction_pSgF + 285 5 bup-sample-iosUITests 0x000000010bee63f9 $s21bup_sample_iosUITestsAAC18testBasicSelectionyyF + 297 6 bup-sample-iosUITests 0x000000010bee644b $s21bup_sample_iosUITestsAAC18testBasicSelectionyyFTo + 43 7 CoreFoundation 0x00007fff23bb138c invoking_ + 140 8 CoreFoundation 0x00007fff23bae49f -[NSInvocation invoke] + 319 9 EarlGrey 0x0000000104e75640 -[GREYTestCaseInvocation invoke] + 112 10 XCTest 0x000000010bbcb121 __24-[XCTestCase invokeTest]_block_invoke.208 + 78 11 XCTest 0x000000010bc251e2 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 57 12 XCTest 0x000000010bc25100 -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 96 13 XCTest 0x000000010bbcac0a __24-[XCTestCase invokeTest]_block_invoke + 1153 14 XCTest 0x000000010bbca6e2 -[XCTestCase testContextPerformInScope:] + 211 15 XCTest 0x000000010bbca77c -[XCTestCase invokeTest] + 137 16 EarlGrey 0x0000000104e682a8 -[XCTestCase(GREYAdditions) grey_invokeTest] + 1576 17 XCTest 0x000000010bbcc4ed __26-[XCTestCase performTest:]_block_invoke_2 + 43 18 XCTest 0x000000010bc251e2 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 57 19 XCTest 0x000000010bc25100 -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 96 20 XCTest 0x000000010bbcc404 __26-[XCTestCase performTest:]_block_invoke.334 + 88 21 XCTest 0x000000010bc38492 +[XCTContext runInContextForTestCase:block:] + 219 22 XCTest 0x000000010bbcbb73 -[XCTestCase performTest:] + 668 23 XCTest 0x000000010bc11077 -[XCTest runTest] + 57 24 XCTest 0x000000010bbc614a __27-[XCTestSuite performTest:]_block_invoke + 365 25 XCTest 0x000000010bbc5874 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 54 26 XCTest 0x000000010bbc5b71 -[XCTestSuite performTest:] + 355 27 XCTest 0x000000010bc11077 -[XCTest runTest] + 57 28 XCTest 0x000000010bbc614a __27-[XCTestSuite performTest:]_block_invoke + 365 29 XCTest 0x000000010bbc5874 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 54 30 XCTest 0x000000010bbc5b71 -[XCTestSuite performTest:] + 355 31 XCTest 0x000000010bc11077 -[XCTest runTest] + 57 32 XCTest 0x000000010bbc614a __27-[XCTestSuite performTest:]_block_invoke + 365 33 XCTest 0x000000010bbc5874 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 54 34 XCTest 0x000000010bbc5b71 -[XCTestSuite performTest:] + 355 35 XCTest 0x000000010bc11077 -[XCTest runTest] + 57 36 XCTest 0x000000010bc4743e __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke + 171 37 XCTest 0x000000010bc47541 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke.84 + 118 38 XCTest 0x000000010bbdfe83 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 588 39 XCTest 0x000000010bc471fd -[XCTTestRunSession runTestsAndReturnError:] + 623 40 XCTest 0x000000010bba96d7 -[XCTestDriver runTestsAndReturnError:] + 456 41 XCTest 0x000000010bc346e4 _XCTestMain + 2484 42 libXCTestBundleInject.dylib 0x0000000104f89be7 __copy_helper_block_e8_32s + 0 43 CoreFoundation 0x00007fff23b0d09c CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 44 CoreFoundation 0x00007fff23b0c808 __CFRunLoopDoBlocks + 312 45 CoreFoundation 0x00007fff23b07694 __CFRunLoopRun + 1284 46 CoreFoundation 0x00007fff23b06e66 CFRunLoopRunSpecific + 438 47 GraphicsServices 0x00007fff38346bb0 GSEventRunModal + 65 48 UIKitCore 0x00007fff47578dd0 UIApplicationMain + 1621 49 bup-sample-ios 0x0000000104c433ab main + 75 50 libdyld.dylib 0x00007fff516ecd29 start + 1 51 ??? 0x0000000000000005 0x0 + 5 )

Screenshots: { "Screenshot At Failure": "/Users/bvenkatnara/Library/Developer/CoreSimulator/Devices/11A5ED71-4686-4F1C-9177-1B3C274AF0AC/data/Containers/Data/Application/68055508-E05B-4C90-8DF1-E8C767EA3ACF/Documents/bup_sample_iosUITests.bup_sample_iosUITests_testBasicSelection-TimeoutException-1DC98835-91E5-4DDB-B7AD-850776E8A071/bup_sample_iosUITests.bup_sample_iosUITests_testBasicSelection.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 ==========

<UITextEffectsWindow:0x7fb4ed541930; AX=N; AX.frame={{0, 0}, {375, 812}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 812}}; alpha=1> |--<UIInputSetContainerView:0x7fb4efe0d080; AX=N; AX.frame={{0, 0}, {375, 812}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 812}}; opaque; alpha=1> | |--<UIEditingOverlayGestureView:0x7fb4efe2f9d0; AX=N; AX.frame={{0, 0}, {375, 812}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 812}}; opaque; alpha=1> | |--<UIInputSetHostView:0x7fb4efe00a20; AX=N; AX.frame={{0, 812}, {375, 0}}; AX.activationPoint={187.5, 812}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 812}, {375, 0}}; opaque; alpha=1>

========== Window 2 ==========

<UIWindow:0x7fb4efd11b30; AX=N; AX.frame={{0, 0}, {375, 812}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 812}}; opaque; alpha=1> |--<UITransitionView:0x7fb4ed509370; AX=N; AX.frame={{0, 0}, {375, 812}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 812}}; opaque; alpha=1> | |--<UIDropShadowView:0x7fb4ed512f40; AX=N; AX.frame={{0, 0}, {375, 812}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 812}}; opaque; alpha=1> | | |--<UILayoutContainerView:0x7fb4ed71f170; AX=N; AX.frame={{0, 0}, {375, 812}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 812}}; opaque; alpha=1> | | | |--<UIToolbar:0x7fb4efd0efa0; AX=N; AX.id='Toolbar'; AX.frame={{0, 812}, {375, 49}}; AX.activationPoint={187.5, 836.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 812}, {375, 49}}; opaque; hidden; alpha=1> | | | | |--<_UIBarBackground:0x7fb4f3d178b0; AX=N; AX.frame={{0, 812}, {375, 83}}; AX.activationPoint={187.5, 853.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 83}}; opaque; alpha=1; UIE=N> | | | | | |--<UIVisualEffectView:0x7fb4f3d17db0; AX=N; AX.frame={{0, 812}, {375, 83}}; AX.activationPoint={187.5, 853.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 83}}; opaque; alpha=1> | | | | | | |--<_UIVisualEffectBackdropView:0x7fb4f3d18bc0; AX=N; AX.frame={{0, 812}, {375, 83}}; AX.activationPoint={187.5, 853.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 83}}; opaque; alpha=1; UIE=N> | | | | | |--<UIImageView:0x7fb4f3d183b0; AX=N; AX.frame={{0, 811.66666666666663}, {375, 0.33333333333337123}}; AX.activationPoint={187.5, 811.83333333333326}; AX.traits='UIAccessibilityTraitImage'; AX.focused='N'; frame={{0, -0.33333333333333331}, {375, 0.33333333333333331}}; opaque; alpha=1; UIE=N> | | | |--<UINavigationBar:0x7fb4ed717380; AX=N; AX.id='bup_sample_ios.EntryView'; AX.frame={{0, 44}, {375, 44}}; AX.activationPoint={187.5, 66}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 44}, {375, 44}}; alpha=1> | | | | |--<_UINavigationBarContentView:0x7fb4ed71f9f0; AX=N; AX.frame={{0, 44}, {375, 44}}; AX.activationPoint={187.5, 66}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 44}}; opaque; alpha=1> | | | | |--<_UIBarBackground:0x7fb4ed71f820; AX=N; AX.frame={{0, 0}, {375, 88}}; AX.activationPoint={187.5, 44}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, -44}, {375, 88}}; opaque; alpha=1; UIE=N> | | | | | |--<UIVisualEffectView:0x7fb4ed40e960; AX=N; AX.frame={{0, 0}, {375, 88}}; AX.activationPoint={187.5, 44}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 88}}; opaque; alpha=1> | | | | | | |--<_UIVisualEffectBackdropView:0x7fb4ed60f9d0; AX=N; AX.frame={{0, 0}, {375, 88}}; AX.activationPoint={187.5, 44}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 88}}; opaque; alpha=1; UIE=N> | | | | | |--<UIImageView:0x7fb4ed40ee50; AX=N; AX.frame={{0, 88}, {375, 0.3333333333333286}}; AX.activationPoint={187.5, 88.166666666666657}; AX.traits='UIAccessibilityTraitImage'; AX.focused='N'; frame={{0, 88}, {375, 0.33333333333333331}}; opaque; alpha=1; UIE=N> | | | |--<UINavigationTransitionView:0x7fb4ed720a10; AX=N; AX.frame={{0, 0}, {375, 812}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 812}}; opaque; alpha=1> | | | | |--<UIViewControllerWrapperView:0x7fb4efe1c4c0; AX=N; AX.frame={{0, 0}, {375, 812}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 812}}; opaque; alpha=1> | | | | | |--<UIView:0x7fb4efe1ace0; AX=N; AX.frame={{0, 0}, {375, 812}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{0, 0}, {375, 812}}; opaque; alpha=1> | | | | | | |--<UIButton:0x7fb4ed71ecc0; AX=Y; AX.label='Production Login'; AX.frame={{20, 471}, {335, 50}}; AX.activationPoint={187.5, 496}; AX.traits='UIAccessibilityTraitButton'; AX.focused='N'; frame={{20, 471}, {335, 50}}; alpha=1> | | | | | | | |--<UIButtonLabel:0x7fb4ed534650; AX=N; AX.label='Production Login'; AX.frame={{118.66666666666669, 485}, {138, 22}}; AX.activationPoint={187.66666666666669, 496}; AX.traits='UIAccessibilityTraitStaticText'; AX.focused='N'; frame={{98.666666666666686, 14}, {138, 22}}; alpha=1; UIE=N; text='Production Login'> | | | | | | |--<UIButton:0x7fb4efe0f2c0; AX=Y; AX.label='Login'; AX.frame={{20, 381}, {335, 50}}; AX.activationPoint={187.5, 406}; AX.traits='UIAccessibilityTraitButton'; AX.focused='N'; frame={{20, 381}, {335, 50}}; alpha=1> | | | | | | | |--<UIButtonLabel:0x7fb4ed535780; AX=N; AX.label='Login'; AX.frame={{147.66666666666669, 395}, {80, 22}}; AX.activationPoint={187.66666666666669, 406}; AX.traits='UIAccessibilityTraitStaticText'; AX.focused='N'; frame={{127.66666666666669, 14}, {80, 22}}; alpha=1; UIE=N; text='Login'>

badrinathvm avatar Nov 04 '19 19:11 badrinathvm

"GREYAppStateTracker": "Waiting for viewDidAppear: call on the view controller. Please ensure that this view controller and its subclasses call through to their super's implementation.

Full state transition call stack for all objects:
UIEditingOverlayViewController:0x7fb4efe305b0 => Waiting for viewDidAppear: call on the view controller. Please ensure that this view controller and its subclasses call through to their super's implementation.

This is an EG synchronization issue with the button's viewDidAppear: not being called. Can you provide us a repro case with our FunctionalTests App?

tirodkar avatar Nov 04 '19 19:11 tirodkar

@tirodkar It's happening on the Demo app as well func testBasicSelectionAndAction() { just tried now , Using pod 'EarlGrey' , 1.15.1`

badrinathvm avatar Nov 04 '19 19:11 badrinathvm

EG 1 isn't supported anymore for bugs in iOS 13. We're just working on a fix for build issues. Is the issue present in EG 2?

tirodkar avatar Nov 04 '19 19:11 tirodkar

Screen Shot 2019-11-04 at 11 41 13 AM

badrinathvm avatar Nov 04 '19 19:11 badrinathvm

@tirodkar how to point to EG2 which version of the pod i need to use it ?

badrinathvm avatar Nov 04 '19 19:11 badrinathvm

https://github.com/google/EarlGrey/blob/earlgrey2/docs/cocoapods-setup.md Tell me if something is missing. It uses XCUITest instead of XCTest.

tirodkar avatar Nov 04 '19 19:11 tirodkar

@tirodkar seeing below error

[!] CocoaPods could not find compatible versions for pod "EarlGreyTest":
  In Podfile:
    EarlGreyTest (= 2.0.0-rc)

Specs satisfying the `EarlGreyTest (= 2.0.0-rc)` dependency were found, but they required a higher minimum deployment target.

badrinathvm avatar Nov 04 '19 19:11 badrinathvm

Hi, I have similar issue. My UI tests are failing on iOS 13 but running just fine on all the previous iOS versions. Issue is that element matcher can not find couple elements/buttons icons in the UI hierarchy, but only iOS 13. Any idea for workaround?

Exception Reason: { "User Info" : { "NSLocalizedDescription" : "Interaction cannot continue because the desired element was not found." }, "Error Info" : { "Search API Info" : "", "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.", "Assertion Criteria" : "assertWithMatcher:sufficientlyVisible(Expected: 0.750000, Actual: 0.000000)", "Element Matcher" : "(respondsToSelector(accessibilityIdentifier) && accessibilityID('icn_menu_dark'))" },

Schweszter avatar Dec 12 '19 15:12 Schweszter

when I upgraded to EarlGrey 2.0.

App is crashing saying failed at Failed to add forwardInvocation:.

can anyone please help me here.

Prabhu1229 avatar Feb 04 '21 01:02 Prabhu1229

I'm encountering the same problem when running my XCUITests on any device on Firebase Test Lab. eDistantObject prints:

Failed to add forwardInvocation

and then calls abort(), and that's about it. Tests don't even start.

Running locally works just fine.

This problem looks to be related with:

  • https://github.com/google/EarlGrey/issues/1155
  • https://github.com/google/EarlGrey/issues/1187

bartekpacia avatar Dec 06 '22 20:12 bartekpacia