Top Banner
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications
11

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

Mar 26, 2015

Download

Documents

Justin McBride
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Ashish MishraAutomation Lifecycle of Mobile Applications

Page 2: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Agenda:

Why automate?

Automation Lifecycle

Application building

Application installation

Launching applications and tests

Collecting test logs and results

Result reporting.

Demos

Q&A

2

Page 3: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Why Automate:

Multiple Phone models

Multiple Operating systems

Multiple Application versions

Multiple Carriers

Device specific features

Complex API testing

Large number of test cases

3

Page 4: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Automation Lifecycle:

4

Page 5: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Automation Lifecycle: Building applications

5

Jenkins – an extendable continuous Integration server. Install Apache tomcat web server Get Jenkins.war from Jenkins-ci.org and deploy.

Jenkins + Android: Setup: Eclipse + Android SDK + ADT Plugin Android App –android update project –p <path to android app> Test App – android update test-project –m <path to App> -p <path to

TestApp> Build the android projects using: “ant clean debug”

Jenkins + iOS: Setup: Mac + Xcode + iOS SDK Build iOS project using: “xcodebuild -configuration ${BUILD_TYPE} -

target ${TARGET_NAME} -sdk ${SIMULATOR_OR_IOS_SDK}”

Page 6: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Automation Lifecycle: Installing Applications

Android: Android SDK provides “adb” which can be used to install/uninstall applications from simulator/devices.

adb [-e | –d <device_id>] install <path to .apk>

adb [-e | –d <device_id>] uninstall <application id>

Non-Jailbroken iOS devices:

Get sources from libimobiledevice.org and compile to create “ideviceinstaller”

This can be used to install/uninstall “IPAs” to any iOS device from command line.

Jailbroken iOS devices:

Install SSH server from Cydia App store.

Unzip IPA, modify Info.plist file to register for URL handler and copy inside device.

6

Page 7: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Automation Lifecycle: Running Applications and launching tests

Android: Applications can be launched from command line in emulators/devices using:

adb shell am start –n com.google.android.contacts/.ContactsActivity –e <Key> <Value>

Jailbroken iOS device: Application need to register as an URI handler.

Install “Erica utilties” from Cydia app store.

Ssh into the device and use following command : uiopen testapp://

Non-Jailbroken iOS device: The only option of launching apps from command line is using:

$ instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate <path-to-your-app>/<appname>.app -e UIASCRIPT <path-to-js-test-file>

7

Page 8: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Automation Lifecycle: Collecting test results and logs

Android:

To fetch logs and files from device to desktop:

adb pull <source path on device> <destination on desktop>

Jailbroken iOS devices:

Use scp to pull back results from device to desktop.

Non-Jailbroken iOS devices:

Fuse4x allows you to mount iOS device’s document directory on the desktop machine by the following command :

Ifuse <mount point> -u <udid of iOS device> --appid <application ID>

8

Page 9: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Automation Lifecycle: Test result reporting

Jenkins provides in-built support for Junit test result xml reports.

Supply the path of test result in junit format in the jenkins job :

Graphs, trends and drill down options are also available.

Jenkins can be configured to preserve selective set or a predefined number of test results.

9

Page 10: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Demos: Automation lifecycle of Android and iOS Applications

10

Page 11: © 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Thank You

11