Get started with UI Testing in Xcode7 in 10 steps

Satyajit Malugu
mobile-testing
Published in
2 min readJun 14, 2015

I can’t help but get excited when apple was talking about UI testing in WWDC 2015, state of the platform talk. Yes, there is appium and yes apple usually sucks at creating testing tools but this year appears to be different. Or perhaps I am sucker for keynote speeches. Well to make a judgement on those, one has to try the tool first hand, below steps will get you there.

Pre-requisite: You need to have a paid apple developer account to do any of these steps.

First, get excited by watching the 2015 WWDC video — https://developer.apple.com/videos/wwdc/2015/?id=406. It goes into a lot of detail and and the end of this process, you should be able to execute the same commands as in the videos. Time spent: 1 hr

Second, upgrade to the latest OS X 11 — El Capitan https://developer.apple.com/osx/download/ on your secondary Mac. This download and installation process takes about another hour.

Third, download the Xcode 7 beta1 — https://developer.apple.com/xcode/downloads/. The download, unzip and dragging to applications took a horrendous amount of time about 3 hrs. YMMV.

Fourth, get the sample code shown in the videos — https://developer.apple.com/library/prerelease/ios/samplecode/Lister/ListerforwatchOSiOSandOSX.zip

Fifth, follow the details steps given in the getting started pdf for iOS (in above zip) to add a developer account, change the bundle identifier and other provisioning profile mush and hope the app runs. Despair, it won’t! You keep getting the ‘shared group container error’, that you don’t understand a rats app about.

Sixth, find the SO question http://stackoverflow.com/questions/27008730/new-lister-app-error-the-shared-application-group-container-is-unavailable-che and hope that it has steps!

Seven, your prayers have been answered! Checkout this answer works and it even has detailed screenshots. Now build and run the app and do the happy dance. It runs!

Eight, as shown in the WWDC video in first step, create a new testing target for UI testing.

Nine, find the automatically created file “/ListerforwatchOSiOSandOSX/Swift/Lister UI Tests/Lister_UI_Tests.swift” and in the test example, click the record button.

Ten, this will open the app and will record your interactions!

--

--