Top Banner
Presented by Date Introducing Aster - a tool for remote GUI testing on Android Yongqin Liu Android Software Enginner @ LMG 2015.02.08~2015.02.14
15

HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

Jul 17, 2015

Download

Software

Linaro
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: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

Presented by

Date

Introducing Aster - a tool for remote GUI testing on

Android

Yongqin LiuAndroid Software Enginner @ LMG

2015.02.08~2015.02.14

Page 2: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

Contents● Background● New Features● How to control remote device● Dependencies● Limitations● Develop with Eclipse● UI Concept● Action Concept/Source Structure● How to add new action● How to add new adb type● Links

Page 3: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

Aster is the abbreviation of Android System Testing Environment and Runtime, which is developed by 0xlab originally, which is said built upon the concept of Sikuli.We can use it to control the UI of local android device, but since it is based on the monkey runner engine, we can not use it to control the device at the remote side. Change it!

Background

Page 4: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

New Features

● Support access for remote device○ only support access via ssh now

● Support input of serial number● Display for logcat/kmsg● Support for AdbShell action● Make it an eclipse project

○ easily to develop/debug

Page 5: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

1. make “ssh aster-adb-host adb devices” worka. add “aster-adb-host” Host in .ssh/config with

necessary account and Hostname informationb. copy public key information to ssh side so that no

interaction when run “ssh aster-adb-host adb”s2. select “ssh” as the adb type3. input serial number you want to control4. Check if you can see the home screen

displayed in the Aster window

How to control remote device

Page 6: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

Dependencies

● adb connection● adb input command● adb screencap command● libopencv-highgui2.4(default in

ubuntu)● libopencv-core2.4(default in

ubuntu14.04)

Page 7: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

Limitations

● Not support Monkeyrunner Yet● Can not edit action or script● No interaction between devices

supported● Only tested on Ubuntu14.04● Call/InstallApk action is not ready

Page 8: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

1. git clone https://github.com/liuyq/aster.git2. Open Eclipse, and import the aster project3. Run/Debug as “Java Application”, and use org.

zeroxlab.aster.AsterMain as Main class4. run ant under the aster project can help to

create the distributable files under dist directory, the dist/aster file can be used to start aster

Develop with Eclipse

Page 9: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

UI Concept

ScreenUpdatePanel

StatusBar

ActionListComponentActionListUIActionButtonCloseButtonNewActionButtonLittleArrowCloseButton

PlayStepStopPannel

Page 10: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

● AsterCommand● AsterOperation● DeviceForAster● UI Components

Source Concept/Structure

Page 11: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

public abstract class AsterCommand { private static final Map<String, Class> \ supportedCommands = \ new LinkedHashMap<String, Class>() { { ... put("Call", Call.class); put("InstallApk", InstallApk.class); put("AdbShell", AdbShell.class); put("Wait", Wait.class); } }; ...}

public class InstallApk extends \ AsterCommand {….}

How to add new action

public class AdbShell extends \ AsterCommand {….}

Page 12: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

public abstract class DeviceForAster { …. public static void initialize(String adbType, String serial) throws Exception { if (adbType == null || Constants.ADB_TYPE_LOCAL.equals(adbType)) { instance = new LocalAdb(serial); return; } else if (adbType.equals(Constants.ADB_TYPE_SSH)) { instance = new SshAdb(serial, Constants.SSH_ADB_HOST); return; } else if (adbType.equals(Constants.ADB_TYPE_MONKEYRUNNER)) { throw new Exception("Monkeyrunner still not implemented yet"); } throw new Exception("Not supported ADB Type:" + adbType); } ...}

public class SshAdb extends DeviceForAster { ... protected ...getAdbSerialArrayList() { ... } public String getScreenShotPath(){ ... } …}

How to add new remote type

Page 14: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP

Demo

Page 15: HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP