2016-07-15 38 views
1

我們的測試工作正常,但沒有明顯的原因(檢查提交),UI測試停止在模擬器中工作(haven'沒有在設備上測試過)。每次需要在UI組件上執行操作時(例如tap()typeText("string here")),我們都會在標題Failure getting list of active applications: AX error -25205中看到錯誤。(使用Swift進行UI測試)失敗獲取活動應用程序列表:AX錯誤-25205

這裏是從點的一切日誌出錯:

t = 13.57s    Find: Elements matching predicate '"TextFieldUsuario" IN identifiers' 
    t = 13.74s    Assertion Failure: UI Testing Failure - Failure getting list of active applications: AX error -25205 
/Users/desenvolvimento/projetos/Mobile-iOS/Mobile-iOSUITests/SupportUITests.swift:45: error: -[Mobile_iOSUITests.LoginViewControllerUITest testLoginComSucesso] : UI Testing Failure - Failure getting list of active applications: AX error -25205 
2016-07-15 09:46:42.722 XCTRunner[22227:716756] -[__NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x7f8728d66170 
    t = 13.74s    Tear Down 
/Users/desenvolvimento/projetos/Mobile-iOS/Mobile-iOSUITests/SupportUITests.swift:45: error: -[Mobile_iOSUITests.LoginViewControllerUITest testLoginComSucesso] : failed: caught "NSInvalidArgumentException", "-[__NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x7f8728d66170" 
(
    0 CoreFoundation      0x0000000102552d85 __exceptionPreprocess + 165 
    1 libobjc.A.dylib      0x0000000101fc6deb objc_exception_throw + 48 
    2 CoreFoundation      0x000000010255bd3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 
    3 CoreFoundation      0x00000001024a1cfa ___forwarding___ + 970 
    4 CoreFoundation      0x00000001024a18a8 _CF_forwarding_prep_0 + 120 
    5 XCTest        0x0000000101a70fcb -[XCAXClient_iOS activeApplications] + 438 
    6 XCTest        0x0000000101a71eb9 -[XCAXClient_iOS interruptingUIElementAffectingSnapshot:] + 102 
    7 XCTest        0x0000000101a92ad9 -[XCUIElementQuery matchingSnapshotsHandleUIInterruption:withError:] + 180 
    8 XCTest        0x0000000101a83d74 __43-[XCUIElement resolveHandleUIInterruption:]_block_invoke + 238 
    9 XCTest        0x0000000101a63629 -[XCTestCase startActivityWithTitle:block:] + 350 
    10 XCTest        0x0000000101a83c79 -[XCUIElement resolveHandleUIInterruption:] + 140 
    11 XCTest        0x0000000101aa3d81 __63-[XCUIElement(XCUIElementEventSynthesis) _dispatchEvent:block:]_block_invoke + 82 
    12 XCTest        0x0000000101a63629 -[XCTestCase startActivityWithTitle:block:] + 350 
    13 XCTest        0x0000000101aa3d20 -[XCUIElement(XCUIElementEventSynthesis) _dispatchEvent:block:] + 405 
    14 XCTest        0x0000000101aa4ea7 -[XCUIElement(XCUIElementEventSynthesis) tap] + 121 
    15 Mobile-iOSUITests     0x0000000110d7cfca _TFC17Mobile_iOSUITests14SupportUITests13executarLoginfTCSo15XCUIApplication5loginSS5senhaSS_T_ + 1210 
    16 Mobile-iOSUITests     0x0000000110d7d653 _TFC17Mobile_iOSUITests14SupportUITests32performarLoginValidoComAplicacaofCSo15XCUIApplicationT_ + 627 
    17 Mobile-iOSUITests     0x0000000110d77d3a _TFC17Mobile_iOSUITests25LoginViewControllerUITest19testLoginComSucessofT_T_ + 138 
    18 Mobile-iOSUITests     0x0000000110d77d82 _TToFC17Mobile_iOSUITests25LoginViewControllerUITest19testLoginComSucessofT_T_ + 34 
    19 CoreFoundation      0x000000010243b5cc __invoking___ + 140 
    20 CoreFoundation      0x000000010243b41e -[NSInvocation invoke] + 286 
    21 XCTest        0x0000000101a5fef3 __24-[XCTestCase invokeTest]_block_invoke_2 + 362 
    22 XCTest        0x0000000101a94613 -[XCTestContext performInScope:] + 190 
    23 XCTest        0x0000000101a5fd78 -[XCTestCase invokeTest] + 169 
    24 XCTest        0x0000000101a603a2 -[XCTestCase performTest:] + 459 
    25 XCTest        0x0000000101a5dcf7 -[XCTestSuite performTest:] + 396 
    26 XCTest        0x0000000101a5dcf7 -[XCTestSuite performTest:] + 396 
    27 XCTest        0x0000000101a4ab10 __25-[XCTestDriver _runSuite]_block_invoke + 51 
    28 XCTest        0x0000000101a6bb4c -[XCTestObservationCenter _observeTestExecutionForBlock:] + 640 
    29 XCTest        0x0000000101a4aa55 -[XCTestDriver _runSuite] + 453 
    30 XCTest        0x0000000101a4b7d1 -[XCTestDriver _checkForTestManager] + 259 
    31 XCTest        0x0000000101a95a9a _XCTestMain + 628 
    32 CoreFoundation      0x00000001024782ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12 
    33 CoreFoundation      0x000000010246df75 __CFRunLoopDoBlocks + 341 
    34 CoreFoundation      0x000000010246d6d2 __CFRunLoopRun + 850 
    35 CoreFoundation      0x000000010246d0f8 CFRunLoopRunSpecific + 488 
    36 GraphicsServices     0x000000010460dad2 GSEventRunModal + 161 
    37 UIKit        0x0000000102908f09 UIApplicationMain + 171 
    38 XCTRunner       0x00000001019cf8ad XCTRunner + 6317 
    39 libdyld.dylib      0x0000000104e2f92d start + 1 
) 

我發現有類似問題的人,但沒有人似乎已經找到了解決我們的情況:

結果1:

https://forums.developer.apple.com/thread/47696

解決方案:安裝El Capitan並更新Xcode;我們已經在El Capitan,我們的Xcode是根據 App Store應用程序的最新版本。

結果2:

iOS UI Testing : Failure getting list of active applications: AX error -25205

解決方案:無問題的答案,得到溶液。

結果3:

UITesting Failure getting list of active application

解決方案:設備上 「啓用UI Atomation」(設置>開發者)。它已經在模擬器中啓用。

我的Xcode版本是7.3.1(7D1014),OS X版本是10.11.4(15E65)。

有人知道如何解決這個問題?也許更新El Capitan到最新版本?

+0

嘗試Xcode的8?或者,也許回到其他方式?我的經驗是,Xcode 7.3.1中的UI測試已經非常糟糕。 – matt

+0

那麼Xcode 8更好嗎? – vitormm

+0

對我來說這是一個很好的事情,但是YMMV。這就是爲什麼我建議你至少嘗試一下。 – matt

回答

1

感謝馬特我能找到一個解決方案。這似乎是Xcode 7.3.1的一個bug。降級到Xcode 7.3.0解決了這個問題。

編輯: 如果有人正在尋找的Xcode 7.3.0下載,你可以在這裏找到: https://developer.apple.com/download/more/

1
[Mobile_iOSUITests.LoginViewControllerUITest testLoginComSucesso] 

似乎是真正的原因。您確定您是否正在調用正確的方法,因爲方法名稱中存在拼寫錯誤testLoginComSucesso

例外是因爲以下

[NSObject(NSObject) doesNotRecognizeSelector:] 

拋出它看起來好像你的LoginViewControllerUITest不承認的方法

+0

考慮到我稱該測試是直接拋出Xcode(在左邊按下它的小球),並且這些說明在該方法的內部,我相信這不是原因。此外,該調用的例外是:'[__NSCFString countByEnumeratingWithState:objects:count:]';我想這是由於AX錯誤而被調用的。 – vitormm

+0

你可以發佈你的testLoginComSuccesso實現嗎? – ldindu

相關問題