Book Image

Testing and securing android studio applications

Book Image

Testing and securing android studio applications

Overview of this book

Table of Contents (18 chapters)
Testing and Securing Android Studio Applications
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The UI test project


The test code to evaluate the UI of an application has to be included in a normal Java project. This Java project will be built into a JAR file, which will be copied in the Android device to evaluate the application under test. Since Android Studio does not support the uiautomator framework, for this section you can use any other tool that allows you create a Java project. The required steps are as follows:

  1. Create a standard Java project. This is the test project where the test code will be implemented using the uiautomator API. You can call this project UITestProject.

  2. Import the JUnit library into your test project. Currently, JUnit 3.8 is the supported version.

  3. Import the Android library as an external JAR into your test project. This JAR is named android.jar and is stored in your Android SDK installation folder under <android-sdk>/platforms/<sdk>/.

  4. Import the uiautomator library as an external JAR into your test project. This JAR is named uiautomator.jar and...