Cross Platform UI testing using Sikuli
Download
Report
Transcript Cross Platform UI testing using Sikuli
Cross Platform UI testing using
Sikuli
-AMIT DIXIT
-DIPESH BHATEWARA
Tech Next - http://meetup.com/technext
Objective
Testing of mobile based application
Current platform specific tools
Challenges
Generic Solution For All The Platforms
Tech Next - http://meetup.com/technext
Mobile Platforms And Testing Tools
Android
iOS
Android
Instrumentation
UI Automation
Robotium
FoneMonkey
Seleniumdroid
Tech Next - http://meetup.com/technext
Frank
Symbian
CTS
(Compatibility
Test Suite)
Android
•
Android Instrumentation
•
•
•
Instrumentation framework based on JUINT3
Framework supports activities , toasts , context menus etc.
Robotium
Extends Android Instrumentation Framework
Can develop powerful test cases
Can handle multiple activities
Blazing fast test execution
Runs on a device
•
Selenium droid
•
•
Runs in android browser
Use native touch events to emulate user interaction
Paid Tool
See Test
Tech Next - http://meetup.com/technext
iOS
UI Automation
• Tests in JavaScript
• Allows you to write test scripts to exercise your application’s user
interface elements
• Runs on a connected device / simulator
FoneMoneky
FoneMonkey is a functional testing tool for the iPhone
providing for the interactive creation, editing and playback of
automation scripts
• Easily incorporated into continuous integration
Frank
•
•
•
•
Provide support for automating functional testing of an iOS app.
Integrate with BDD tools like cucumber
Works on device and simulator
Tech Next - http://meetup.com/technext
Challenges
Generic Challenge
Diversity of devices /platforms
Application complexity
Technical Challenge
Large no of test cases
Verification of UI
Tech Next - http://meetup.com/technext
Solution
Test Automation
Generic Way for Test Automation on multiple platforms(Use tools
like Sikuli). This will solve maintenance problem.
Build Reliable and comprehensive test framework
Benefits
Cost Reduction
Increased productivity
Better application Quality
Tech Next - http://meetup.com/technext
Nature of Mobile Applications
(xcode – objective C)
Calculator(XC
ODE –
Objective C)
(webos – JS/CSS)
Calculator
(webos –
JS/CSS)
Tech Next - http://meetup.com/technext
Application
(Calculator)
•(java –
android
SDK)
Calculator
(javaandroid SDK)
Approach to solve the problem
• Image based test automation
• Automate user operations eg. Click, type, dragdrop, mouse actions etc.
• Visual verification of the expected output
• Not dependent on platform underneath
• Can be used to automate emulator as well as device.
Tech Next - http://meetup.com/technext
Advantages of the approach
• Can accurately test GUI and rendering of
applications.
• Write test outside the device
• Can be used to automate multiple devices without
getting into details of each platform technology
• Can perform actions on Emulator (Virtual Boxes)
• Easy to automate.
Tech Next - http://meetup.com/technext
Limitations of the approach
• Highly depends on the Resolution.
• Can not run in background.
• Dynamic paths are tricky to automate.
Tech Next - http://meetup.com/technext
What is Sikuli?
• Visual technology to automate GUI using images.
• MIT research project. Open Source license.
• Sikuli IDE
• Sikuli Script API
• Automates anything on screen without internal
API's support
• Works on Windows, Mac, Linux.
Tech Next - http://meetup.com/technext
Sample Sikuli Script
Tech Next - http://meetup.com/technext
DEMO
Tech Next - http://meetup.com/technext
Solution proposed in demo to test Calculator
• Use Java for test Project, Use Junit
• Import Sikuli Script API
• Write single test which will use an interface for calculator operations
• Implement interface for Android and Iphone with different set of
images required for automation
• Run same test by changing the configuration on multiple
emulators/devices
• Can see the device on your machine using VNC and use that view to
run your test on.
Tech Next - http://meetup.com/technext
Q&A
Tech Next - http://meetup.com/technext