6

I'm trying to add and run UI Automation tests with Xcode 7 on an older project. Here's what I did:

  1. Added a new UI Testing target
  2. Changed the compiler version of that target to Default compiler (Apple LLVM 7.0)
  3. Recorded a test using the iPhone 6 Plus iOS9 simulator (worked like a charm)

Now, when I try to run the recorded test I get the following error:

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)

Senseful
  • 86,719
  • 67
  • 308
  • 465
YogevSitton
  • 10,068
  • 11
  • 62
  • 95

6 Answers6

2

This error seems to be complaining about "Target to be tested" field selected while adding UI Test Target.Does your "Target Application" property under UI Test Target -> General tab correctly shows your main app selected? A happy config would look like this,

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
Sushant
  • 440
  • 3
  • 8
  • 1
    I had the very same issue and [this](http://stackoverflow.com/questions/32276523/nsinternalinconsistencyexception-when-running-uitesting-with-xcode-7?answertab=votes#tab-top) solved it. – Kalicz Oct 30 '15 at 11:22
2

Its might be due to some issue with your Target settings.

Try the following.

  1. Delete the existing target .
  2. Create a new Target by selecting "iOS UI Testing bundle" again.
  3. Then link your test files one by one.

It works.

arango_86
  • 4,236
  • 4
  • 40
  • 46
0

I had the same issue and solved it by not using a Legacy build location as described in this answer: https://stackoverflow.com/a/32658990/901334

If I use "Legacy", UI tests can be recorded, but fail when I try to run them. Using "Unique" as setting and they work fine. (this can be reproduced with a new project)

Xcode → Preferences → Locations → Derived Data → Advanced... → [x] Unique

Community
  • 1
  • 1
Mark
  • 6,647
  • 1
  • 45
  • 88
0

I had the same problem on a physical iPad. When I finally deleted the app and all of its data and then shut down and rebooted the device the problem was resolved.

Jan ATAC
  • 1,212
  • 1
  • 18
  • 36
0

You must add in your UITest target, in the relative "Build Settings" section, a custom "User-Defined settings" property:

enter image description here

with the keys:

TEST_TARGET_NAME : YourTargetName
USES_XCTRUNNER: YES (optional)

Now you're able to run your UI Tests.

elp
  • 8,021
  • 7
  • 61
  • 120
0

This happens when you have the UI test files in the unit test target, make sure the file is in the correct target.

DeyaEldeen
  • 10,847
  • 10
  • 42
  • 75