Slide 1

Slide 1 text

UI AUTOMATION IOS BLACK-BOX TESTING

Slide 2

Slide 2 text

BEFORE TEST RUN YOUR APP THROUGH XCODE ▸ Your app must be in DEBUG mode ▸ App downloaded from App Store / TestFlight / HockeyApp won’t work (which are in RELEASE mode) ▸ To Perform automation, your app is suggested to be Built and Run / Profiled directly from Xcode

Slide 3

Slide 3 text

AFTER BUILD CHOOSE YOUR INSTRUMENT ▸ Automation is your friend :)

Slide 4

Slide 4 text

▸ Timeline, Details, Settings READY TO SCRIPT INSTRUMENT LAYOUT

Slide 5

Slide 5 text

READY TO TEST RUNNING AUTOMATION ON REAL DEVICE ▸ One point to note: If you would like to do this on a real device, remember to turn the following switch ON on your device. ▸ Settings > Developer > Enable UI Automation

Slide 6

Slide 6 text

START SCRIPTING…OR START CAPTURING! ▸ Automation basically supports Javascript, but even if you don’t know anything about programming, you could still create a testing script ▸ Use the Capture button ▸ Press on it. Start your actions. And they will be recorded as a script :D

Slide 7

Slide 7 text

TESTING TIME RECORD AND TRACE LOG ▸ To run the testing script, click the top-left button ▸ To look at the logs during a test, select

Slide 8

Slide 8 text

IF YOU KNOW JAVASCRIPT WRITE SOMETHING MORE

Slide 9

Slide 9 text

TWO TIPS ON SCRIPTING UIALOGGER ▸ logFail ▸ logIssue ▸ logPass ▸ logStart ▸ logDebug ▸ logError ▸ logMessage ▸ logWarning ▸ Example:
 UIALogger.logPass(“User login success!”);

Slide 10

Slide 10 text

TWO TIPS ON SCRIPTING ALERT HANDLER ▸ Prepare an alert handler before the main script ▸ It will be triggered whenever an alert is detected

Slide 11

Slide 11 text

SO JUST KEEP CALM AND RUN YOUR TEST COMMON PROBLEMS ▸ Testing on real device, but always no response on Capture / Stop instantly on run…
 Did you turn “Enable UI Automation” ON? ▸ Testing on simulator, but type string is not working…
 Go to Simulator Menu > Hardware > Keyboard > Toggle Software Keyboard ▸ Can I run multiple tests at the same time?
 Yes, you can run multiple instruments at the same time. But don’t add the same script to different instruments. They will overwrite each other.

Slide 12

Slide 12 text

MY SCRIPT IS STILL NOT WORKING AND I DON’T KNOW WHY?!?! Add target.delay(1); BUT IT’S NOT COOL AT ALL…