How to automate UI testing on iOS projects. Follow this guide to set up your first UI automated testing.
--
Brought to you by Skygear.io -- an open source development kit for mobile, web & IoT apps.
Find us on Twitter @Oursky
2. BEFORE TESTING...
• YourappmustbeinDEBUGmode
• AppdownloadfromAppStore/Testflight/HockeyApp
won’twork(whicharein RELEASEmode)”
• Toperformautomation,yourappissuggestedtobe
builtandrun/profileddirectlyfromXcode
Run your app through Xcode
5. • One point to note: If you’d like to do this on a
real device, remember to turn the following
switch ON on your device.
• Settings > Developer > Enable UI Automation
READY TO TEST!
Running automation on real device
6. Start scripting … or
Start capturing!
• Automation basically supports Javascript, but even if
you don’t know anything about programming, you can
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
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. Just keep calm and run your test!
Common problems And ANSWERS
• 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. But it’s not cool at all...
My script is still not working
and I don’t know why?????
Add target.delay(1);
13. Brought to you by Oursky
Build your mobile app fast
skygear.io (open source)