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:
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
.Import the JUnit library into your test project. Currently, JUnit 3.8 is the supported version.
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>/
.Import the uiautomator library as an external JAR into your test project. This JAR is named
uiautomator.jar
and...