XCUITest Command line tools

Tools such as Appium, and other Continuous Integration-related tools rely on being able to run tests programmatically from other processes.


For UIAutomation, we had the Instruments tool, which was enough to launch an instruments test run, without having to work from within the Xcode UI.


Are there plans similar tools for XCUITest? It looks like a rather complicated process to bundle all the separate test apps and such, and we haven't yet found a way to push the XCUITests to a mobile device/simulator and then start the tests and gather pass/fail data.


Would such a tool be considered in the near future?

Replies

This should already work. Like unit testing in the past, UI testing in Xcode 7 supports being invoked from xcodebuild. When invoked from xcodebuild, testing works just like in Xcode - your tests and your target application are built, installed, and executed, and tests results are being collected and sent back.

Thanks for the response Joar,


Continuous-integration servers (especially those which run as "Infrastructure-as-a-service" models like Travis, Cloudbees, CircleCI, Sauce Labs) aren't usually trusted with full Xcode project files.


Right now we use the Instruments commandline tool to run tests on a developer build of the app. This way, the only artifact required for testing is a compiled app file (with developer permissions).


Wouldn't xcodebuild require the full source of the app, the entire project file?


Appium tests specifically live outside of a developer's app, and are communicated via http to the appium server. How we would like to handle this is by building a standard "appium xcuitest" which is essentially a web server that waits for http commands and dynamically runs tests on the device. We've already experimented with building an "xcuitest app" for any given iOS app, but the exact sequence to kick-off the testing process on the device is not currently accessible to us.


Not sure if you've heard of Appium. It's an open source testing framework for mobile. It uses the same protocol as Selenium, the industry standard for programmatic browser UI testing. Appium has by now, after about three years of active development, become a (if not The) leading test automation framework for mobile. Sauce Labs, Perfecto Mobile, Xamarin Test Cloud, and Amazon all support appium testing in their Test Clouds. Check out discuss.appium.io for a large community of QA developers and test automation engineers who use appium daily all over the world (large representations in the USA, India, China, Japan). There's even multiple Appium meetups 🙂


Anyways, I'd be really interested in opening up a dialog about testing on iOS. We frequently come up with lots of bugs and corner cases in iOS automation and can hopefully contribute helpful information and repro cases for bugs.


Migrating our current iOS driver from UIAutomation to XCUITest would be great if we can figure out how to run our standard XCUITests on users' apps.







P.S. Would you consider applying to talk or attend GTAC, the Google Test Automation Conference? It's been focusing heavily on Mobile Test Automation the past couple years.

So you're actually representing Appium? That was not clear to me from your original post. If you haven't already done so, you (Appium) might want to get in touch with our developer tools evangelist Stefan Lesser.


What you've outlined in your second post isn't currently supported by the UI testing support provided by Xcode 7. Please file enhancement requests with the details of what you would want to see added / enabled.

Yep, I'm one of the core developers that represents Appium 🙂


I'll get in contact with Stefan Lesser and submit enhancement requests.


Thanks for your time

That's awesome. Thank you!

Hi Joar!

I'm facing with the problem to disable and enable bluetooth when my app is executing. I woudl like to know if by Appium I can simulate commands (taps) outside my app window .

I woudl like to move the app in background , go to settings, disable the bluetooth, and finally go back to my app.

Is it possible? What solutions can you suggest to me ?

Thanks a lot in advance!

Hi jonahss,

Earlier I had instruments trace templates which i was using for UIAutomation to get the iOS device WiFi IP.

With XCode 8.x it is not working, have you got anything working to replace running instruments from command line so that we can programmatically execute UIAutomation.


Thanks,

bittu

@jonahss @joar

Hello Jonahss,

I am using xctests framework via appium for doing mobile automation tests. Our iOS Native application uses GLKview (openGL) for our videos in the app and this xctests are unable to detect the element ids for video. Could not find them in inspector and page source....any ideas if Apple xctests support for GLKView? or do i need to import any openGl library in maven for detecting elements or any ideas? Let me know if you need more information

Thanks


-Chanakya