Where do I get started with Android app testing.
- What are common bugs on mobile apps
- Which tools and software should I have.
- How do I get Android device logs.
- How do I enable a device to debug mode
- How do I install adb and what is the android sdk
- Which IDE is an android developer using
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
Getting Started With Android Mobile App Testing
1. Getting Started With Android
Mobile App Testing
by Martin Poschenrieder
CEO and Founder testmunk
June 22nd, 2015
Twitter: @mposchenrieder
Presentation for students at Portnov QA school
3. Twitter: @mposchenrieder
About me
• Born in Germany, moved to Silicon Valley 3 years ago.
• First QA related task, 10 years ago for German handset
manufacturer
• First launched several mobile apps when realizing pain of app
testing and started testmunk.
5. Twitter: @mposchenrieder
Goals for this session
1. Getting started on Android QA
2. Better understanding the “developer language” and terminologies
3. Being more productive: Faster bug investigation and replication
Twitter: @mposchenrieder
6. Twitter: @mposchenrieder
Agenda
• What are common bugs on mobile
• What do we need to QA an android app
• Android sdk
• Adb - how do we interact with a device
• Android device logs
• What kind of tools does the developer use to code an android app?
• Sample app
8. Twitter: @mposchenrieder
What kind of bugs will you find in your QA job?
Backend issues/ !
Problems retrieving content
Reference: http://blog.testmunk.com/flipboard-transitioning-from-manual-to-automated-ui-testing/
9. Twitter: @mposchenrieder
What kind of bugs will you find in your QA job?
Twitter: @mposchenrieder
Timeout issues!
E.g. after XX seconds nothing happens
Reference: http://blog.testmunk.com/flipboard-transitioning-from-manual-to-automated-ui-testing/
11. Twitter: @mposchenrieder
What kind of bugs will you find in your QA job?
Crashes!
Reference: http://blog.testmunk.com/flipboard-transitioning-
from-manual-to-automated-ui-testing/
12. Twitter: @mposchenrieder
What kind of bugs will you find in your QA job?
UX issues!
Reference: http://blog.testmunk.com/flipboard-transitioning-
from-manual-to-automated-ui-testing/
13. Twitter: @mposchenrieder
What do we need to QA an android app?
.apk file
apk = Android package kit a mini USB cable An Android phone
a computer (Mac/Win/Linux) Source code (nice to have)
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
Android sdk installed
14. Twitter: @mposchenrieder
Android SDK
What is the Android SDK?
“A software development kit that enables developers to create applications for the
Android platform. The Android SDK includes sample projects with source code,
development tools, an emulator, and required libraries to build Android
applications. Applications are written using the Java programming language and
run on Dalvik, a custom virtual machine designed for embedded use which runs on
top of a Linuxkernel.” (webopedia)
16. Twitter: @mposchenrieder
What is adb?
ADB provides the bridge between your machine and your computer. it
provides a terminal-based interface for interacting with your phone’s
file system. Since Android platform is based on Linux, command-line
is often required to perform certain advanced operations on your
device using root access.
http://forum.xda-developers.com/showthread.php?t=2011772
17. Twitter: @mposchenrieder
How can I install adb
• adb is part of android sdk that comes by default with android studio
• Can be downloaded here: http://developer.android.com/sdk/
index.html
• Can also be downloaded manually: https://developer.android.com/
sdk/installing/index.html
19. Twitter: @mposchenrieder
How to enable android device on debug mode
Android 4.x devices:!
!
Go to Settings > Developer Options > USB Debugging.
!
NOTE: For devices running Android 4.2.2 or later, you may need to unlock
Developer Options before it is available within the Menu:
!
Go to Android home screen.
Pull down the notification bar.
Tap "Settings"
Tap "About Device"
Tap on the "Build Number" button about 7 times.
Developer Mode should now be unlocked and available in Settings > More >
Developer Options
http://www.companionlink.com/support/kb/Enable_Android_USB_Debugging_Mode
20. Twitter: @mposchenrieder
Which adb commands should I know?
Adb devices!
! Shows the devices that are connected. The devices that you want to get logs or run your automated testrun !
!
Adb kill-server // Adb start-server!
! Commonly used when ‘adb devices’ doesn’t recognize the device.!
!
Adb install <file_path_to_apk>!
Adb uninstall <file_path_to_apk>!
adb is part of ddms (Dalvik Debug Monitor Server)
simply execute ddms in terminal
21. Twitter: @mposchenrieder
Which adb commands should I know? (2)
!
Record Video!
adb shell screenrecord /sdcard/demo.mp4!
!
Take screenshot !
adb shell screencap -p /sdcard/screen.png!
!
Many more commands available -> google ‘adb commands’
22. Twitter: @mposchenrieder
Device logs are helpful (especially for the
developer) to investigate bugs
FATAL EXCEPTION: main
E/AndroidRuntime( 635): java.lang.RuntimeException: Only a background thread is allowed to do that - called from
ItemCache:clearItems
E/AndroidRuntime( 635): currentThread = main
E / A n d r o i d R u n t i m e ( 6 3 5 ) : M a i n L o o p e r T h r e a d = m a i n E / A n d r o i d R u n t i m e ( 6 3 5 ) : a t
flipboard.util.SharedAndroidUtil.requireBackgroundThread(SharedAndroidUtil.java:152)
E/AndroidRuntime( 635): at flipboard.io.SectionDataCache.softRequireBackgroundThread(SectionDataCache.java:150)
E/AndroidRuntime( 635): at flipboard.io.SectionDataCache.clearItems(SectionDataCache.java:80)
E/AndroidRuntime( 635): at flipboard.service.User.removeSectionInternal(User.java:2104)
E/AndroidRuntime( 635): at flipboard.service.User.removeSection(User.java:1975)
E/AndroidRuntime( 635): at flipboard.service.User.unfollowSection(User.java:1943)
23. Twitter: @mposchenrieder
How can I access the android device logs?
Logcat (The device log)!
adb logcat –d!
!
Export to a file on your desktop!
Windows: adb logcat –d > %UserProfile%Desktopdevice_log.txt!
Mac: adb logcat -d > ~/Desktop/device_log.txt!
!
Windows & Mac: adb logcat -c!
To clear
24. Twitter: @mposchenrieder
The manifest file (good to know about it)
• “No launchable activity found”
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:name="ExampleActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
The manifest file presents essential information about your app to the Android system… (read more)
26. Twitter: @mposchenrieder
What IDEs do android developers use?
• IDE = Integrated development Environments) - where the “cool” stuff
gets build :)
• Most common are:
• IntelliJ
• Eclipse
• Android Studio
31. Twitter: @mposchenrieder
Good to know
• Mobile test automation is becoming more and more popular
• Device fragmentation as one major reason
• Using resources effectively
• QA Engineers need to have a powerful ‘toolbox’ to use the best
approaches for the job to be done (like performance testing, ux
testing, test automation…)
• QA is the one who usually understand the most about a product and
connects ‘business people’ with devs.
!
32. Twitter: @mposchenrieder
FAQ / common questions
• Can I run an apk on both emulator and device —> YES, different on iOS though.
• What can be automated?
• Good average is 30-50% sometimes more, sometimes less depending on the app.
• How do I deal with UI changes and changing my test cases
• Good structure is very helpful. E.g. Page Object Framework (Link here)
What are your questions?
33. Twitter: @mposchenrieder
Where do I get started
• Sample android app and sourcecode: https://github.com/
testmunk/TMSampleAndroid
• Check out our blog on blog.testmunk.com, where we cover
topics such as:
• Getting started with mobile test automation
• Moving from manual to automated testing
• Page Object Framework