Testing the Xcode UI "Error Attempting to Launch"

I am new to user interface testing and am trying to integrate this feature into an existing project. I try the simplest tests to just see the structure in action, but I have some difficulties. I have added a new goal for testing the UI test suite to the project, and I can perform my main test. However, I continue to receive the error message "Error while trying to run", which always occurs when I try to run the application in my test. He also says something about the "null token for the current process reference."

Here is the code I'm testing:

@implementation SKYPracticeUITesting - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. self.continueAfterFailure = NO; // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication *app = [[XCUIApplication alloc] init]; // In UI tests it's important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. [app launch]; } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the class. [super tearDown]; } - (void)testExample { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. NSLog(@"Something is happening"); } @end 

Any help would be greatly appreciated, especially considering that the process in Objective-C is not well documented.

+5
source share

All Articles