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

Hello,

Recently I trying to adjust my test suite for iOS 9 (I’m working with Xcode 7.1, appium 1.4.16, python-client) During this task I encountered couple major issues like:

All of this has huge impact on my tests. Each investigation for those issues leads me to UIautomation framework bug. Finally I looked into Xcode release notes. One thing attracted my attention:

The existing UIAutomation support in Instruments is deprecated. Use UI testing in Xcode 7.

So my questions are:

  1. What is Appium approach here?
  2. Are you considerate support for this new XCUITest framework introduced by Apple? (i found only thtis GitHub - appium-boneyard/XCUITest-driver )
  3. Does anyone tried this new UI Test framework? If yes, can you share your impressions about it?

P.S Please do not take this as a criticism ;). I just want to know your opinion here. For most of issues caused by Apple politics a found here pretty smart workarounds. Advantage of the opportunity I would like to give big shout out to Appium Team! :smile:

Regards,
Stefan

5 Likes

I don’t have any answers here but am interested as well! Thanks for posting this @stefan

So this seems to have the most updates:
I’d either watch this GitHub ticket or see if @jonahss has any updates. ++ on this topic as well.

Hi!
So we are definitely aware of UIAutomation being deprecated by apple. We are working under the assumption the UIAutomation will continue to exist for about 6 months, but will probably get more and more bugs introduced into it and Apple won’t fix them.

We have two new full-fledged iOS drivers currently under construction!

Check out the appium-xcuitest-driver repo. This is a wrapper for facebook’s webdriveragent project. This new driver, which I am currently developing uses XCUITest to run tests on iOS simulators, real devices, and even Apple TvOS.

Advantages of the new XCUITest driver:

  • Runs on sims and real devices, including TvOS
  • Is able to run on multiple connected devices in parallel
  • Is much faster (way faster)
  • Less buggy!
  • Better control of simulators
  • Can dismiss system-level alerts!

Disadvantages:

  • Only works on iOS 9.0 and up
  • Still no Notification testing :frowning:

For older versions of iOS, there is also the option to use Facebook WebdriverAgent. Which is simulator-only but back-compatible.

Progress:
In two weeks I will be adding this driver to appium 1.5 (releasing soon on it’s own schedule, but beta is on npm). It won’t be fully-featured, but it covers the most commonly-used webdriver commands. This will be behind a desired capability: automationName: 'xcuitest'. Any help beta testing, or building out more commands will be appreciated. Even just interest to show my managers that people are happy to use it will be good :slight_smile:

8 Likes

Thanks a lot for reply ! :blush: Looking forward to try it in 1.5 version… Good luck with this XCUITest driver development.

1 Like

Hey there @jonahss, question about the new xcuitest.
Any chance that it gets around this problem? If so, that would be amazing! If not, ok, it still is amazing :smile:

Thanks!
Eric

XCUITest won’t be able to help there at all :sweat:

I was running Native XCUITests in Xcode, and as soon as you open a new app or a different intent (tapping a deep link to another app), the XCUITest completely crashes.

But the WebdriverAgent approach (the other driver listed above) is able to automate in that case, if I’m not mistaken.

2 Likes

I’ll definitely be trying out the beta as soon as its ready. We’ve been looking forward to the XCUITest driver since it was announced.

It’s technically ready right now if you want to give it a spin.

It’s still pretty rough around the edges. Needs to have more endpoints implemented, needs better error handling, needs support for Real Devices, and Safari/Webview support is flakey.

After 1.5 is released, it will be wrapped into 1.5 as a ‘beta’.

Try npm install appium-xcuitest-driver. Run node . in the module’s directory. It will start listening on port 4723 :smile:

how to try on Mac without node? we normally install appium as “npm install appium”.

Hi Jonahss,

npm was unable to find the driver package. Do I need to update to a newer npm?
I get the error message below. Any thoughts on how to get this to install?

/tmp/webdriver $ npm install -g appium-xcuitest-driver
npm ERR! Darwin 14.5.0
npm ERR! argv “node” “/usr/local/bin/npm” “install” “-g” “appium-xcuitest-driver”
npm ERR! node v0.12.6
npm ERR! npm v2.12.1
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/appium-xcuitest-driver
npm ERR! 404
npm ERR! 404 ‘appium-xcuitest-driver’ is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Expect appium1.5 experience the new framework

Well you still need Node installed, yes.

Ah yes, update Node if you are able. I could go back and publish for an earlier version, but eventually we will be requiring newer versions of Node for appium, so may as well get a head start :wink:

After Appium 1.5 is released, then this could be added in a minor release after that.

Hi Jonahss, I have upgraded node and npm ( to be node 5.3.0, and npm 3.3.12) but I still get the same error when trying to install appium-xcuitest-driver. Any thoughts on wht may be my problem?

npm install -g appium-xcuitest-driver
npm ERR! Darwin 14.5.0
npm ERR! argv “/usr/local/Cellar/node/5.3.0/bin/node” “/usr/local/bin/npm” “install” “-g” “appium-xcuitest-driver”
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/appium-xcuitest-driver
npm ERR! 404
npm ERR! 404 ‘appium-xcuitest-driver’ is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR! /usr/local/lib/node_modules/appium-webdriveragent-driver/npm-debug.log

I think it was a wrong link provided. There is no ‘appium-xcuitest-driver’ as a registered npm package.
I’ve found this one https://www.npmjs.com/package/appium-webdriveragent-driver
So maybe npm install appium-webdriveragent-driver should work.

update no the npm install appium-webdriveragent-driver is not having automationName: ‘xcuitest’ as an option. So seems like the correct npm (appium-xcuitest-driver) is just not available as package to install at the moment

1 Like

Hello again :slightly_smiling:

So I’m tracking this discussion since the beginning and still got some doubts. My main problem is: how to use (or test in my framework) different iOS drivers, when I using only Python client (Poor JS skills :confused: ) . To sum up my question:

  1. Available iOS drivers:
  1. New XCUITest driver will be delivered with Appium 1.5 behind a desired capability: automationName: ‘xcuitest’ right?

Please, help me understand how I can test those drivers withou installing 1.5 beta.

Regards,
Stefan

UPDATE: I was searching answers for my question how to handle those different types of drivers in iOS tests. Only topic is here: http://stackoverflow.com/questions/31990494/different-types-of-drivers-automation
but i still can’t get it :confused:

i would appreciate if someone help me to make it clear.

Ok here we go. Welcome to the new year everybody :slightly_smiling:

My bad about not having npm install appium-xcuitest-driver working. The package.json file still had the old module name in it, so it didn’t publish. Should be good to go now.

The new appium 1.5 architecture is to have a main Appium driver, which runs as a server and forwards sessions to other drivers within it. Examples of these drivers would be appium-ios-driver and appium-android-driver. Those driver can in turn proxy commands to other drivers they spawn, like appium-chromedriver and appium-safari-driver. Each of these drivers inherits from a BaseDriver class. Drivers can be run as individual standalone servers, or can be called programmatically from another Nodejs program.

So appium-ios-driver, appium-webdriveragent-driver, and appium-xcuitest-driver all extend the BaseDriver class. Right now, appium-ios-driver is included in appium 1.5 and all iOS tests get send to this driver. We will be including appium-xcuitest-driver (and possibly later appium-webdriveragent-driver) into appium behind special desired capabilities (automationName: “xcuitest”). At a certain point, we will deprecate the ios-driver and replace it with xcuitest-driver since Apple is deprecating Intruments.

3 Likes

Hi Jonahss,

I was just able to install the appium-xcuitest-driver, but it has an issue when I try run a test.

Exception captured when calling Before method of hook: DriverInfo. - Exception: [A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): automationName xcuitest is not included in the list. (33)]

Have I missed a setup step maybe or is the npm module not up to date still?