lecture on automation
TRANSCRIPT
![Page 1: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/1.jpg)
![Page 2: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/2.jpg)
How to organize execution of tests
on real Android devices
Misha Beshkin. DevConfu 2. Jurmala May, 2014
![Page 3: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/3.jpg)
Agenda
● Little bit about me● A little about Nitro Nation and Creative Mobile● A lot about A.C.T.H.U.L.H.U● Qs&As
![Page 4: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/4.jpg)
Misha Beshkin
● Was born and raised in Daugavpils, Latvia
● Studied in Daugavpils University, Faculty of Humanities.
● Moved to Tallinn in December 2003● Worked for Symantec Estonia as QA engineer
● In 2013 changed for Creative Mobile
![Page 5: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/5.jpg)
Creative Mobile
![Page 6: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/6.jpg)
Nitro Nation
![Page 7: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/7.jpg)
A.C.T.H.U.L.H.U
© DreamLand Toys
Automation Controller. Tester's Hands Unloading LeadsHuman Unemployment
![Page 8: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/8.jpg)
How it looks like?
![Page 9: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/9.jpg)
What does it do?Download latest
orset apk
Uninstall preciously installed version
Install apk Collect logs
Run Activity
Save log for a device
![Page 10: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/10.jpg)
How devices are added?
String apkExe = "adb"; AndroidDebugBridge.initIfNeeded(false);AndroidDebugBridge adb = AndroidDebugBridge.createBridge(apkExe, true);if (adb == null) { System.err.println("Invalid ADB location."); System.exit(1);}
Init ADB
Prerequisites:● Android SDK● DDMS library● ADB binary
![Page 11: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/11.jpg)
How devices are added?
final List<IDevice> deviceList = new ArrayList<IDevice>();AndroidDebugBridge.addDeviceChangeListener(new AndroidDebugBridge.IDeviceChangeListener() {
@Override public void deviceChanged(IDevice device, int arg1) { // not implement }
@Override public void deviceConnected(IDevice device) {
System.out.println(String.format("%s connected", device.getSerialNumber())); Map<String, String> properties = null;
try { properties = getDeviceInformation(device); } catch (Exception e) { e.printStackTrace(); } if (properties!=null) { deviceList.add(device); } }
@Override public void deviceDisconnected(IDevice device) { System.out.println(String.format("%s disconnected", device.getSerialNumber()));
}});
Add devices to list
![Page 12: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/12.jpg)
Execute shell command
ShellOutputReceiver shellOutputReceiver= new ShellOutputReceiver("MemTotal");device.executeShellCommand("cat /proc/meminfo", shellOutputReceiver);String memory = shellOutputReceiver.toString();
Get RAM info
ShellOutputReceiver shellOutputReceiver= new ShellOutputReceiver("Processor");device.executeShellCommand("cat /proc/cpuinfo", shellOutputReceiver);String cpu = shellOutputReceiver.toString();
Get CPU info
ShellOutputReceiver shellOutputReceiver= new ShellOutputReceiver("GLES:");device.executeShellCommand("dumpsys", shellOutputReceiver);String gpu = shellOutputReceiver.toString();
Get GPU info
![Page 13: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/13.jpg)
ShellOutputReceiverpublic class ShellOutputReceiver implements IShellOutputReceiver { private String result; private int checkRunning = 0; private String grepPattern = "";
public ShellOutputReceiver(String grepPattern) { this.grepPattern = grepPattern; }
@Override public void addOutput(byte[] bytes, int i, int i2) { String result = ""; result = new String(bytes); String[] array = result.split("\r\n"); for (int i=0; i< array.length; i++) { if (array[i].contains(grepPattern)) { this.result = array[i]; break; } } }
@Override public void flush() { }
@Override public boolean isCancelled() { return false; }
@Override public String toString(){ return result; }}
![Page 14: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/14.jpg)
Show Time
![Page 15: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/15.jpg)
Questions & Answers
![Page 16: Lecture on automation](https://reader031.vdocuments.mx/reader031/viewer/2022020101/55a9ec3c1a28ab29638b4871/html5/thumbnails/16.jpg)
Thank you for attention
http:// misha.beshkin.lvmail:// [email protected]
facebook:// beshkintwitter:// midbarphone:// +372-53454663