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

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

According to the below Appium roadmap, version 1.6 with “XCUITest backend integration” has an ETD of 3/2016. Do we have a new ETD?

Roadmap: https://github.com/appium/appium/blob/master/ROADMAP.md

I think we do! Let me get a firm date on that.

iOS 10 removed Instruments and only supports XCUITest so we will make sure to have XCUITest working great before ios 10 is released.

Isaac just bundled the appium-xcuitest-driver into the main appium project in our master branch on github. We will be including beta support for XCUITest in appium version 1.6.0

After a beta period where people can help us find bugs, we will publish another version with better support.

We plan to publish all this before Apple’s official release of ios 10

3 Likes

Hello guys.
How to run XcuiTestDriver using node?

Regards,
Pranoday

@jonahss You mentioned under Advantages of the new XCUITest driver that “Is able to run on multiple connected devices in parallel”. I haven’t given it a try. But just curious. Does the same hold true for simulators also. Can i run multiple simulators in the same machine.

Hi @mathewkuruvila .
It should be true for Simulators as well.Instruments was not allowing running tests parallely on multiple devices/emulators attached to/started on single MAC machine.Now after introduction of XcuiTest there is no involvement of intruments.

Thanks and Regards,
Pranoday

wow that’s great. thank you