[iOS9 UIAutomation] What is Appium approach to UIAutomation deprecation by Apple

You don’t give much info about your situation (left out basic info like Xcode version, language you are using, etc), so basically you are asking for a good guess. I don’t use the appium-xcuitest-driver and have no experience with it whatsoever. However, I think I’m a fairly good guesser.

The first thing I did was google the error that I quoted above. Lot’s of information on this. There are suggestions that an upgrade to the latest Xcode version would fix this. Since the Xcode information was not supplied, I’ll leave that for you to determine.

Here is a blog post detailing problems with certificates and permissions that give the dreaded error 65:

My wild guess is that this is your issue. Good luck!

2 Likes

Hi Jonah. I’m eager to try out the new UI Testing library support. Which Appium versions (server app and node server) should I try?

1 Like

What is/will be the alternative to predicates?

Yes please try it!
npm install appium-xcuitest-driver

Well, you still have xpath and class name, and accessibility Id.

Accessibility ID is the recommended way, if you can configure your app for it. It helps with handicapped users too!

Hello!

I am experiencing the same issue @heliojr was having.

info WebDriverAgent-driver Using default agent
info WebDriverAgent-driver Launching WebDriverAgent on the device
info WebDriverAgent-driver Waiting for WebDriverAgent to start on device
info WebDriverAgent-driver xcodebuild exited with code 65 and signal null
ERR! WebDriverAgent-driver Error: xcodebuild failed with code 65
ERR! WebDriverAgent-driver at SubProcess. (lib/webdriveragent.js:73:18)
ERR! WebDriverAgent-driver at emitTwo (events.js:100:13)
ERR! WebDriverAgent-driver at SubProcess.emit (events.js:185:7)
ERR! WebDriverAgent-driver at ChildProcess. (lib/teen_process.js:177:14)
ERR! WebDriverAgent-driver at emitTwo (events.js:100:13)
ERR! WebDriverAgent-driver at ChildProcess.emit (events.js:185:7)
ERR! WebDriverAgent-driver at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
ERR! WebDriverAgent-driver [Error: xcodebuild failed with code 65]
info WebDriverAgent-driver Shutting down WebDriverAgent
ERR! MJSONWP Encountered internal error running command: TypeError: Cannot set property ‘sessionId’ of undefined
ERR! MJSONWP at WebDriverAgent.quit$ (lib/webdriveragent.js:148:27)

I am using Xcode 7.2.1 and my tests are written in Java. I’ve done a lot of searching to try and figure out this issue, but have been unable to find a lot of proposed solutions. What can I try to fix this?

1 Like

I have the same problem when using version 1.0.1, in version 1.0.0 it would load the app for me and then have a different issue. but in 1.0.1 it has this new problem immediately after the simulator finishes loading(the app does not get launched). It happens with both xcode 7.1 and 7.2

I think it may be a problem with the version of WebDriverAgent bundled with the the xcuitest driver. I just tried installing the latest WebDriverAgent manually and then copied the installed folder to the location the xcuitest driver has it, and got past the error you mentioned. It proceeded to launch my app on the simulator. But then I got a problem getting an element my code was trying to interact with.

@farnett could you try and see if it works better for you

npm install -g webdriveragent

this installs to /usr/local/lib/node_modules/webdriveragent

inside that folder is one called WebDriverAgent I coppied that to replace the one of the same name at
/usr/local/lib/node_modules/appium-xcuitest-driver/WebDriverAgent
.

@Tree thanks for the advice. I have downloaded 1.0.0 by using npm install [email protected] and that seems to have worked to give me that version.

This has gotten me past my previous issue and I can now see the app open with the blue screen, however, it then crashes shortly after. Before I was not getting far enough to have the WebDriverAgent actually start up, so it seems like I have progressed a little further

info WebDriverAgent-driver detected that WebDriverAgent is running at url http://XX.XX.XX.XXX:8100
info WebDriverAgent Mar 16 10:56:51 Ford-Arnett XCTStubApps[14167]: ServerURLHere->http://XX.XX.XX.XXX:8100<-ServerURLHere
info WebDriverAgent
info WebDriverAgent-driver WebDriverAgent started at url http://XX.XX.XX.XXX:8100
info JSONWP Proxy Proxying [POST /session] to [POST http://localhost:8100/session] with body: {“desiredCapabilities”:{“app”:“XX/XXXXX/XXXXX/XXXXXXX/MyApp.app”,“bundleId”:“com.XXXXXX.XXXXXX”}}
info JSONWP Proxy Got response with status 200: {“value”:“Interrupting test”,“sessionId”:null,“status”:13}
ERR! WebDriverAgent-driver Error: An unknown server-side error occurred while processing the command.
ERR! WebDriverAgent-driver at JWProxy.command$ (lib/proxy.js:139:15)
ERR! WebDriverAgent-driver at tryCatch (/Users/ford.arnett/npm/testing_node_modules/node_modules/babel-runtime/regenerator/runtime.js:67:40)
ERR! WebDriverAgent-driver at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/ford.arnett/npm/testing_node_modules/node_modules/babel-runtime/regenerator/runtime.js:315:22)
ERR! WebDriverAgent-driver at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/ford.arnett/npm/testing_node_modules/node_modules/babel-runtime/regenerator/runtime.js:100:21)
ERR! WebDriverAgent-driver at GeneratorFunctionPrototype.invoke (/Users/ford.arnett/npm/testing_node_modules/node_modules/babel-runtime/regenerator/runtime.js:136:37)
ERR! WebDriverAgent-driver at run (/Users/ford.arnett/npm/testing_node_modules/node_modules/core-js/library/modules/es6.promise.js:104:47)
ERR! WebDriverAgent-driver at /Users/ford.arnett/npm/testing_node_modules/node_modules/core-js/library/modules/es6.promise.js:115:28
ERR! WebDriverAgent-driver at flush (/Users/ford.arnett/npm/testing_node_modules/node_modules/core-js/library/modules/$.microtask.js:19:5)
ERR! WebDriverAgent-driver at _combinedTickCallback (node.js:370:9)
ERR! WebDriverAgent-driver at process._tickCallback (node.js:401:11)
ERR! WebDriverAgent-driver { [Error: An unknown server-side error occurred while processing the command.] status: 13, value: ‘Interrupting test’, httpCode: 200 }
info WebDriverAgent-driver Shutting down WebDriverAgent
info WebDriverAgent-driver xcodebuild exited with code null and signal SIGTERM
info WebDriverAgent-driver Shutting down WebDriverAgent
ERR! MJSONWP Encountered internal error running command: Error: An unknown server-side error occurred while processing the command.
ERR! MJSONWP at JWProxy.command$ (lib/proxy.js:139:15)

I did some more investigating. It seems like what is happening is that the blue screen of the XCUITestRunner comes up, minimizes and then tries to open my app. However, the app never opens and I see the error in the terminal.

It’s crashing when I try to create my driver:
driver = new IOSDriver(urlAddress, capabilities);

Is there anything wrong with how I am creating the driver? Is it something to do with my capabilities? I have tried this on iPad air 9.0, 9.2 and then iPhone 6 9.0 all in the simulator.

Are you setting an implicit wait value? if so don’t do that for now, it causes a problem
What language are you using? if the c# driver then you wont be able to progress past loading the app as there is a probelm with the format of the json returned in the messages. see here: https://github.com/appium/appium-xcuitest-driver/issues/15

You could try using the 1.0.1 version of xcuitest and update the WebDriverAgent folder as a I mentioned previously.

I am using Java. It is actually crashing before I can ever get to the point where I would be able to set an implicit wait. Like I said in my last post, it crashes on the line:
driver = new IOSDriver(urlAddress, capabilities);

Since it crashes here, I am never able to create the driver to use it in any way.
This leads me to believe if it is an issue relating to my code, it must be a capability or url issue.

I have now tried with the xcuitest driver 1.0.1 using the webdriveragent you suggested from installing webdriver agent. This gave me an error similar to my very first post except it was “xcodebuild failed with code 70 instead of 65.” I also tried 1.0.1 xcuitest with the webdriveragent from 1.0.0 and got the same error from my last post:

info JSONWP Proxy Got response with status 200: {“value”:“Interrupting test”,“sessionId”:null,“status”:13}

It seems like there is something going on with the new webdriveragent, however, it also seems like there is something else going on here which is causing the crash.

@jonahss Do you have any ideas? I would really appreciate it, this is a major blocker on my current project.

1 Like

Can some one please help me in this regard?

Thanks for your time.

What about xciutest usage for now? Is xcuitest-driver ready? What status this thing has?

Hello, I want to test the appium-xcuitest-driver. I installed with npm install -g appium-xcuitest-driver. How do I run this now? Or how do I make sure that Appium is using this driver now, when I run my tests instead of the old ios-driver? Like forcing Appium to pick up that driver! When I let the new driver run with node it starts listening on localhost, but if I start my test now, we kill all drivers and start a new one. Now its not picking up the xcuitest-driver. When I set capabilities.setCapability(“automationName”, “xcuitest”); doesnt help either, it states: Details: The desiredCapabilities object was not valid for the following reason(s): automationName xcuitest not part of Appium,Selendroid,WebDriverAgent.
thanks for some help what the next steps could be to get it to run

1 Like

has anyone tried the appium-xcuitest-driver for tvOS? If so, can someone post a sample desired caps for that? I tried running one of my iOS tests with this driver, seems fine. However, I can’t seem to get it working on the Apple TV Simulator (tvOS 9.2, latest Xcode 7.3.1).

Also asked here: Apple tvOS Support

Hey, can you maybe ave a look at my question above and help me? I can not help you with tvOS, because I dont even get my iOS tests to pick up the xcuitest-driver and how I understood it, you did…yey. thanks for some info

@julesmummdry:
In my case, I started the new appium server (appium-xcuitest-driver) using “Node .”
My tests don’t kill and restart the appium server, so they just started using this new server. Now, I did not go deep and run all my tests, just checked a basic one where I can launch the simulator and login to my application.

The capabilities.setCapability(“automationName”, “xcuitest”) will not work now. This will work only when Appium bundles this driver into their future appium 1.5.x release (hopefully). For now, this driver is meant to be used on its own.

One way I see for you is to modify your test code to not kill and restart Appium server (easiest). There could be other ways like maybe uninstall Appium, and modify your automation to kill/start this other Node process instead.

1 Like

@jonahss
I have appium 1.5.3 installed on my MAC.Does XcuiTestDriver now a part of this Appium latest version?

Thanks and Regards,
Pranoday

Nope, we have not yet included XCUITestDriver into appium yet. You will see a note in the Appium Release notes when it is added.

Hello guys.
How to run XcuiTestDriver using node?

Regards,
Pranoday