Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Testing and securing android studio applications

You're reading from  Testing and securing android studio applications

Product type Book
Published in Aug 2014
Publisher Packt
ISBN-13 9781783988808
Pages 162 pages
Edition 1st Edition
Languages

Testing the UI


The UI can be evaluated using the white-box testing or black-box testing. In the white-box testing, UI components are checked in the activities that manage them. Activity testing will be explained in the next chapter, that is, Chapter 9, Unit and Functional Tests. The black-box testing is based on the uiautomator API. This API includes classes to capture and manipulate components in the application under test. This type of test does not require you to know the internal implementation of the application.

Android Studio does not directly support the uiautomator framework, but since it is available in the Android SDK, we can use it anyway. The steps to complete the testing process are as follows:

  1. Install the application under test on a device (real device or an emulator).

  2. Analyze the UI components of the application under test, employing the uiautomatorviewer tool.

  3. Create a Java test project to implement your test cases using the uiautomator API.

  4. Compile the test project into a JAR...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}