ios - 无法在旧项目上运行 UI 测试

标签 ios xcode xcode7 ui-testing xcode-ui-testing

我正在尝试使用 Xcode 7 在旧项目上添加和运行 UI 自动化测试。 这是我所做的:

  1. 添加了一个新的 UI 测试目标
  2. 将该目标的编译器版本更改为默认编译器 (Apple LLVM 7.0)
  3. 记录了使用 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/

相关文章:

ios - Objective-C 中的 nonnull 是什么?

ios - NSHTTPCookie:expiresDate 始终为空

ios - iCarousel 上的缩放变换显示屏幕外区域

ios - 如何接收其他应用程序的推送通知?

xcode - Interface Builder 的颜色选择器中的颜色错误

ios - iOS Xcode plist 警告是什么意思?

objective-c - EXC_BAD_ACCESS在随机位置的iOS 9

ios - 同时使用框架和静态库的 CocoaPods

ios - 架构 arm64 (iOS) 的 undefined symbol

ios - 使用静态 IP 的 WIFI 连接不会调用 kCFSocketAcceptCallBack