我正在尝试使用 Xcode 7 在旧项目上添加和运行 UI 自动化测试。 这是我所做的:
- 添加了一个新的 UI 测试目标
- 将该目标的编译器版本更改为默认编译器 (Apple LLVM 7.0)
- 记录了使用 iPhone 6 Plus 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)
最佳答案
此错误似乎是在提示在添加 UI 测试目标时选择了“要测试的目标”字段。您在 UI 测试目标 -> 常规选项卡下的“目标应用程序”属性是否正确显示了您选择的主要应用程序? 一个快乐的配置看起来像这样,
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
关于ios - 无法在旧项目上运行 UI 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32678065/