Upgrade to Pro — share decks privately, control downloads, hide ads and more …

UI Automation

UI Automation

iOS Black-box Testing using Instruments by Apple

975ff6c8166f6f32889f004a904ffa39?s=128

Oursky Limited

November 06, 2015
Tweet

Transcript

  1. UI AUTOMATION IOS BLACK-BOX TESTING

  2. 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
  3. AFTER BUILD CHOOSE YOUR INSTRUMENT ▸ Automation is your friend

    :)
  4. ▸ Timeline, Details, Settings READY TO SCRIPT INSTRUMENT LAYOUT

  5. 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
  6. 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
  7. 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
  8. IF YOU KNOW JAVASCRIPT WRITE SOMETHING MORE

  9. TWO TIPS ON SCRIPTING UIALOGGER ▸ logFail ▸ logIssue ▸

    logPass ▸ logStart ▸ logDebug ▸ logError ▸ logMessage ▸ logWarning ▸ Example:
 UIALogger.logPass(“User login success!”);
  10. TWO TIPS ON SCRIPTING ALERT HANDLER ▸ Prepare an alert

    handler before the main script ▸ It will be triggered whenever an alert is detected
  11. 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.
  12. MY SCRIPT IS STILL NOT WORKING AND I DON’T KNOW

    WHY?!?! Add target.delay(1); BUT IT’S NOT COOL AT ALL…