2015-09-20 26 views
6

我想在舊項目上添加和運行Xcode 7的UI自動化測試。 這裏就是我所做的:不能在舊項目上運行UI測試

  1. 增添了新的UI測試目標
  2. 改變了目標的編譯器版本默認的編譯器(蘋果LLVM 7.0)
  3. 使用iPhone 6加iOS9模擬器錄製的測試(工作就像一個魅力)

現在,當我嘗試運行記錄的測試,我得到以下錯誤:

failed: caught "NSInternalInconsistencyException", "No target application path specified via test configuration: testBundleURL:file:///xxxxxxxxxxx/PlugIns/PageonceUITests.xctest/ productModuleName:(null) testsToSkip:(null) testsToRun:(null) reportResultsToIDE:no sessionIdentifier:<__NSConcreteUUID 0x7fc818d181a0> 7045B650-CDAF-4EC9-9738-83F78E1514D8 pathToXcodeReportingSocket:(null) disablePerformanceMetrics:no treatMissingBaselinesAsFailures:no baselineFileURL:(null) targetApplicationPath:(null) targetApplicationBundleID:(null)

回答

2

這個錯誤似乎是在添加UI測試目標時選擇了「Target to be tested」字段。你在UI Test Target - > General選項卡下的「Target Application」屬性是否正確顯示你選擇的主應用程序? 快樂的配置是這樣的,

2015-10-04 17:30:50.960 XCTRunner[22941:4703128] Found configuration <XCTestConfiguration: 0x7fbf3050c8b0> 

testBundleURL:file:///Users/username/Library/Developer/Xcode/DerivedData/App-fxeyzrynjcscxzaxjvmnormcjhbr/Build/Products/Debug-iphonesimulator/APPUITests-Runner.app/PlugIns/APPUITests.xctest/ 
       productModuleName:APPUITests 
        testsToSkip:(null) 
        testsToRun:(null) 
      reportResultsToIDE:YES 
       sessionIdentifier:<__NSConcreteUUID 0x7fbf30503430> B324DF9D-769F-4217-901F-24482A719005 
    pathToXcodeReportingSocket:(null) 
     disablePerformanceMetrics:no 
treatMissingBaselinesAsFailures:no 
       baselineFileURL:(null) 
      targetApplicationPath:/Users/username/Library/Developer/Xcode/DerivedData/APP-fxeyzrynjcscxzaxjvmnormcjhbr/Build/Products/Debug-iphonesimulator/AppName.app 
     targetApplicationBundleID:com.bundle.appBundle.app.dev 
       reportActivities:no 
+1

我有相同的問題和[這](http://stackoverflow.com/questions/32276523/nsinternalinconsistencyexception-when-running-uitesting-with-xcode-7?answertab=votes#tab-top)解決了它。 – Kalicz

0

我有同樣的問題,通過與這個答案說明不使用遺留構建位置解決了這個問題:https://stackoverflow.com/a/32658990/901334

如果我使用「遺產」,UI測試可以被記錄,但是當我嘗試運行它們時會失敗。使用「獨特」作爲設置,他們工作正常。 (這可以用一個新的項目被複制)

的Xcode→首選項→位置→導出數據→高級→... [X]獨特

0

我曾在一個物理的iPad同樣的問題。 當我最終刪除應用程序及其所有數據,然後關閉並重新啓動設備時,問題已解決。

0

它可能是由於您的某個問題目標設置。

請嘗試以下操作。

  1. 刪除現有目標。
  2. 再次選擇「iOS用戶界面測試包」以創建新的目標。
  3. 然後逐個鏈接您的測試文件。

它的工作原理。

相關問題