Top "Android-testing" questions

The Android testing framework

Testing database on Android: ProviderTestCase2 or RenamingDelegatingContext?

I've implemented access to a database using SQLiteOpenHelper from the android.database package within some classes (with pattern DAO). I …

android database testing android-testing
Reset app state between InstrumentationTestCase runs

One of my QA engineers is supporting an app with a fairly large codebase and a lot of different SharedPreferences …

android-testing android-espresso android-instrumentation
ApplicationTestCase deprecated in API level 24

I created a default empty project on Android Studio 2.1.2 with API 24. In the sample project, Google offers a depreciated class …

android testing android-testing
What's the difference between getTargetContext() and getContext (on InstrumentationRegistry)?

I'm using the new Android Testing Support Library (com.android.support.test:runner:0.2) to run Instrumentation Tests (a.k.a …

android android-testing
Mocking library/framework that works best in Android?

I'm developing Android application using third party libraries (Twitter4j). I want to be able mock those objects (also objects …

android unit-testing mocking android-testing
Espresso how to test if Activity is finished?

I want to assert that my Acitivty that I am currently testing is finished when certain actions are performed. Unfortunately …

android testing android-activity android-espresso android-testing
Unable to get Robotium to work in Android Studio

I'm struggling to get Robotium to work on the gradle-based Android Studio and I can't find the way to do …

android gradle robotium android-testing ui-testing
How to emulate step counter sensor in the Android devices?

I want to emulate user's walking and count their steps for auto testing. I tried to search for the solution, …

android android-testing autotest
How to obtain coverage for Android project using Espresso tests

I used to write Android tests using Robotium and retrieve the coverage using Emma. Recently I changed to use Espresso …

android code-coverage android-testing android-espresso gradle-android-test-plugi
Android Unit Test : how to clear SharedPreferences

I am trying to clear all SharedPreferences added during my tests. I already read some posts and the official documentation (…

android unit-testing sharedpreferences android-testing