19
Ernest Holston and Brandi Amstutz Mobile Testing Using MonkeyRunner REU Program at ECU "Software Testing - Foundations, Tools, and Applications

Ernest Holston and Brandi Amstutz Mobile Testing Using MonkeyRunner REU Program at ECU "Software Testing - Foundations, Tools, and Applications

Embed Size (px)

Citation preview

MonkeyRunner Testing Tool for Android Applications

Ernest Holston and Brandi AmstutzMobile Testing Using MonkeyRunnerREU Program at ECU "Software Testing - Foundations, Tools, and Applications1Mobile DevelopmentSet of processes and procedures involved in writing software for a small, wireless computing device such as smartphones or tablets1

Software development kits (SDKs) are available for most mobile platforms (Android, BlackBerry, Apple, etc.) and provide a range of developer tools necessary to create mobile applications

Android SDKTools to build, test, and debug Android appsOpen source/no costSDK download available here1: http://searchsoa.techtarget.com/definition/Mobile-application-development

Mobile testingCrucial element of software developmentApplication should function on devices with different:Operating SystemsDevice manufacturersMemoryScreen resolutionScreen sizeSensor hardwareTypes (smartphone or tablet)Data Connection Automation toolsAutomation tools save time and money by using test scripts to repeat a test procedure multiple timesIncrease the speed of regression tests Examples:RobotiumSupports Android OSAutomatic black box test casesFree to downloadTestdroid CloudSupports Android OS Fully Automated testing on a cloud of devicesCalabashSupports Android and iOSOpen source/free to download Android SDKMonkeyRunner

What is MonkeyRunner?MonkeyRunner is a tool that provides an Application Programming Interface (API) for writing programs that control an Android device.2

Interactive through command prompt using JythonUse commands to write a script2: http://developer.android.com/tools/help/monkeyrunner_concepts.html5MonkeyRunner ModulesMonkeyRunnerClass of utility methodsProvides methods that MonkeyDeviceRepresents a device or emulatorProvides methods that simulate interactionsMonkeyImageRepresents a screen capture imageProvides methods related to screen capturesCommand Examplestouch(integer x, integer y, string type)type represents a key event (DOWN, UP, DOWN_AND_UP)type(string message)wake()writeToFile(string fileName, string format)sameAs(MonkeyImage otherImage, float percent)Percent indicates the percentage of pixels that need to be the same for the method to return trueTechnical componentsEclipse IDEPyDev Extension for EclipseJythonAndroid SDKAndroid Debug BridgeCommand line tool that allows interaction with a connected deviceAndroid Package (APK) for the application to be testedFile format used to install applications on Android OSAndroid device connected through USB (or emulator)Android drivers for specific device installed on computer

testScript.py.apk fileAndroid device connected via USB

Screenshots are saved to file

Console

script

programming languages:python and jythonPythonClear and powerful object-oriented programming language, comparable to Perl, Ruby, Scheme, or Java3Open source/free to downloadPython provides a Beginner's GuideCode examples from this basic tutorialJythonImplementation of the high-level, dynamic, object-oriented language Python seamlessly integrated with the Java platform4Allows you to run Python on Java platformFree to downloadIBMs tutorialUsing Jython with MonkeyRunner interactive command line tool:3: http://wiki.python.org4: http://www.jython.org/archive/21/docs/whatis.html

Executing Test script from command prompt

Use the following command format:monkeyrunner v ALL Executing test script from from eclipse

screenshot feature

MonkeyRunner allows scripts to write screen captures to a file for analysisScreenshot analysisECU Mobile application provides access to mobile versions of BlackboardOneStopJoyner LibraryECU transitand more!Compare the user interface on a smartphone and a tablet:SmartphoneTabletDevice ManufacturerMotorolaSamsungModelRAZR MGalaxy Tab 2 7.0OSAndroid 4.1.2Android 4.1.1Screen Size4.37.0Screen Resolution960 x 540 qHD1024 x 600Memory1 GB RAM/8GB ROM8 GBConnection TypeWi-FiWi-FiMotorola RAZR MSamsung Galaxy Tab 2 App homepageOneStop Mobile log in

*Labels for credentials are not lined up correctly on smartphone*

Motorola RAZR MSamsung Galaxy Tab 2 Navigation to transit home page was delayed for smartphone by more than 2 minutes

Referenceshttp://developer.android.com/tools/help/monkeyrunner_concepts.html#APIClasseshttp://developer.android.com/sdk/index.htmlhttps://code.google.com/p/robotium/https://cloud.testdroid.com/web/homeOleksii Starov, Sergiy Vilkomir, and Vyacheslav Kharchenko, "Cloud Testing for Mobile Software Systems: Concept and Prototyping", Proceedings of the 8th International Conference on Software Engineering and Applications (ICSOFT-EA 2013), Reykjavik, Iceland, July 29-31, 2013.