Cannot start user interface testing in an earlier project

I am trying to add and run user interface automation tests with Xcode 7 in an older project. Here is what I did:

  • A new user interface testing goal has been added.
  • Changed the compiler version of this target for the Default compiler (Apple LLVM 7.0)
  • A test was recorded using the iOS9 iPhone 4 Plus 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 in test configuration: testBundleURL: file ///xxxxxxxxxxx/PlugIns/PageonceUITests.xctest/ productModuleName: (zero) testsToSkip: (zero) testsToRun: null (testToRunes: null) no sessionIdentifier: <__NSConcreteUUID 0x7fc818d181a0> 7045B650-CDAF-4EC9-9738-83F78E1514D8 pathToXcodeReportingSocket: (null) disablePerformanceMetrics: no treatMissingBaselinesAsFailures: noApplePrice (target) null targetPileFileFileNullPathFile

+6
source share
5 answers

This error seems to be complaining about the "Target Testing" field selected when adding the target user interface test. Does the "Target Application" property in the "Target Target Target" → "General" section correctly show your main application? A happy configuration 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 
+2
source

Perhaps this is due to some problems with the settings of Target .

Try the following.

  • Delete an existing target.
  • Create a new Target by selecting " iOS UI Testing bundle " again.
  • Then link your test files one at a time.

He works.

+1
source

I had the same problem and solved it without using the Legacy build location as described in this answer: fooobar.com/questions/188980 / ...

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

Xcode → Preferences → Location → Derived Data → More ... → [x] Unique

0
source

I had the same problem on a physical iPad. When I finally deleted the application and all its data, and then turned off and restarted the device, the problem was resolved.

0
source

You should add to your goal UITest , in the relative section " Build Settings ", your own custom settings property:

enter image description here

with keys:

TEST_TARGET_NAME : YourTargetName
USES_XCTRUNNER : YES (optional)

Now you can run your user interface tests.

0
source

All Articles