This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
12 / 105
Dec 2015

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.

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-driver8
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.

14 days later

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:

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-driver3
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-driver21
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

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:

  2. 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-automation45
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.

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?

I tried omitting the automationName: xcuitest from my capabilities and I can get further(also tried adding xcuitest to the desired-caps.js file inside the appium-base-driver package - with the same end result). It will launch a simulator and open my app. But as soon as the app is ready to interact with I get an error. It may be a problem with localhost on my machine but i'm not really sure). As in order to get the webdriveragent-driver to be accessible from the machine I run the tests on (im running the tests over the network), I had to change the default host address in index.js to my mac's ipaddress.

An excerpt of the error is as below.

'info WebDriverAgent Jan 13 12:28:42 AUK-PDMAC29 XCTStubApps[1136]: Built at Jan 13 2016 12:26:23
info WebDriverAgent 
info WebDriverAgent Jan 13 12:28:42 AUK-PDMAC29 XCTStubApps[1136]: WebDriverAgent started on port 8100
info WebDriverAgent 
info WebDriverAgent-driver detected that WebDriverAgent is running at url http://10.28.244.237:8100
info WebDriverAgent Jan 13 12:28:42 AUK-PDMAC29 XCTStubApps[1136]: ServerURLHere-        >http://10.28.244.237:8100<-ServerURLHere
info WebDriverAgent 
info WebDriverAgent-driver WebDriverAgent started at url http://10.28.244.237:8100
info JSONWP Proxy Proxying [POST /session] to [POST http://localhost:8100/session] with body:     {"desiredCapabilities":{"app":"/Users/Shared/Apps/FIPhone.app","bundleId":"com.fiserv.ubank"}}
info JSONWP Proxy Got response with status 200: {"value":{"capabilities":{"device":"iphone","browserName":"uBank Dev","sdkVersion":"9.1","CFBundleIdentifier":"com.fiserv.ubank"}},"sessionId":"DD388F24-9C24-4893-86FE-14560FE73D96","status":0}
info MJSONWP Responding to client with driver.createSession() result:    {"appPackage":"nz.co.mcom.phone","platformName":"iOS","autoAcceptAlerts":"true","app":"/Users/Shared/Apps/FIPhone.app","deviceType":"iPhone","devic...
info HTTP <-- POST /wd/hub/session 200 37075.029 ms - 261 
info HTTP --> POST /wd/hub/session/c6e07e2a-d427-4097-8616-09b875606d01/timeouts 
info MJSONWP Driver proxy active, passing request on via HTTP proxy
info JSONWP Proxy Proxying [POST /wd/hub/session/c6e07e2a-d427-4097-8616-09b875606d01/timeouts] to [POST http://localhost:8100/session/DD388F24-9C24-4893-86FE-14560FE73D96/timeouts] with body: {"type":"implicit","ms":3000}
info JSONWP Proxy Got response with status 200: {"value":"Unhandled endpoint: /session/DD388F24-9C24-4893-86FE-14560FE73D96/timeouts -- http://localhost:8100/ with parameters {\n    wildcards =     (\n        \"session/DD388F24-9C24-4893-86FE-14...
info JSONWP Proxy Replacing sessionId DD388F24-9C24-4893-86FE-14560FE73D96 with c6e07e2a-d427-4097-8616-09b875606d01
info HTTP <-- POST /wd/hub/session/c6e07e2a-d427-4097-8616-09b875606d01/timeouts 200 8.915 ms - 293`

Hi @Tree Appium dev team will be able to help you much better if you could log this as an issue at git19.

Hi @Tree thanks for helping us test xcuitest driver.

You don't need the 'automationName: xcuitest' if you're running the xcuitest driver by itself. That desired capability will only be added for the main Appium driver, so it can know which driver (regular ios or xcuitest) to proxy commands to.

I think your problem right now is that the xcuitest driver does not recognize the /timeouts endpoint and is responding with an error. The test should continue just fine, but your test script may be exiting when it hits the error after sending a timeout command.

Please respond with more bugs and bug reports by creating issues on the github repository for xcuitest. Appium discuss is usually for general discussion, and not for technical debugging.

Hi @jonahss,

Your input is awesome.
We're working on building an iOS/Android automation framework and wanted to check with you on this. Our biggest concern is Apple deprecating Instruments which comprises UIAutomation framework. How does this all come thru with Appium? Even though the majority of the mobile methods we're using are the regular find methods, we also call into findElementByIOSUIAutomation method. So, we would have to rewrite all of our iOS test cases to use the new XCUITest framework and call them from Appium? or bypass Appium completely and execute the XCUITests thru XCode plugin from Jenkins CI?. We don't want to maintain 2 different code bases (XCUITest with iOS and the regular Appium/Selenium methods written in Java when working on Android).

Please advise us. Is there a timeframe on when Apple would deprecate Instruments for good?
Btw, the new XCUITest doesn't work with iOS 8 and below. So, there we are with another dilemma.

We're totally confused here and any clarifications would be great.

Hi @appium

Yes you are correct that XCUITest will not work on versions of iOS prior to iOS 9. For older versions of iOS, users can still use Instruments. Keep your older versions of Xcode, so that once Apple removes Instruments support you will still be able to run tests.

We don't know Apple's timeframe at all :frowning: It would be really useful for us all if we could get an answer from Apple. I will try sending them a message, but if you (and others) post bug reports to Apple asking about it maybe they will answer us.

findElementByIOSUIAutomation is something I hadn't thought about. You are right, with XCUITest, this locator strategy will not be available at all.
Hopefully the new API in XCUITest will be more reliable and you can just use the regular Appium findBy methods. If you come up with specific cases where you cannot locate an element, create an issue on the appium-xcuitest-driver repository on github and we can figure out how to solve the issue.