Essential Android Inter-app UI testing with UIAutomator edit forum

Prepare your project and write the first UIAutomator test

Add the required libraries into the dependencies section of your Android module’s build.gradle:

android {
...
  defaultConfig {
    ...
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  }
}

dependencies {
  ...
  androidTestCompile 'com.android.support.test:runner:0.5'
  androidTestCompile 'com.android.support.test:rules:0.5'
  androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
  androidTestCompile 'com.android.support:support-annotations:23.4.0'
}

⚠ Note that of course the versions may differ in the mean time.

After this sync with the changes.

Then add a new Java class inside the androidTest folder:

public class InterAppTest extends InstrumentationTestCase {
private UiDevice device;

@Override
public void setUp() throws Exception {
   device = UiDevice.getInstance(getInstrumentation());
}

public void testPressHome() throws Exception {
  device.pressHome();
}
}

By making a right click on the class tab and on “Run “InterAppTest” executes this test.


Table Of Contents
39 ACRA
64 Menu
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
165 Inter-app UI testing with UIAutomator
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close