Questions tagged [android-instrumentation]

Base class for implementing application instrumentation code.

Base class for implementing application instrumentation code.

When running with instrumentation turned on, this class will be instantiated for you before any of the application code, allowing you to monitor all of the interaction the system has with the application. An Instrumentation implementation is described to the system through an AndroidManifest.xml's <instrumentation> tag.

Reference: http://developer.android.com/reference/android/app/Instrumentation.html

526 questions
0
votes
1 answer

Why simulating touch events in Lollipop doesn't work

I want to inject touch events into the device. I use instrumentation for that. The method works well on Jelly Bean, but it doesn't inject nor does it give any error in Lollipop. When I searched I found that it might be due to the enforcement of…
0
votes
0 answers

Adding Dagger-2 to Android Studio

I asked this question previously https://stackoverflow.com/questions/35981039/instrumentation-doesnt-inject-touch-in-rooted-device which states that instrumentation doesn't work on Lollipop and later versions. After some deep search I found that we…
0
votes
2 answers

Gradle Spoon: Plugin with id 'spoon' not found

Trying to use spoon framework with Android Studio gradle project but getting an error when trying to add spoon plugin : buildscript { repositories { maven { url 'https://maven.fabric.io/public' } } dependencies { classpath…
0
votes
1 answer

inflating activity content fails in instrumentation

I am trying to setup espresso in a project. I created a new empty activity project in Android Studio (1.5.1) It has no problems running added the espresso configurations to the project and a test class. When running the test I am getting …
0
votes
1 answer

Put multiple “testXXX()” functions in a Android UnitTest Class

I maked Android UnitTest by Robotium(a support tool that help to test UI).When one Test class only include one “testXXX()” function,it was successful.But when I put multiple “testXXX()” functions in a Android UnitTest Class. I want to these…
zys
  • 1,306
  • 3
  • 18
  • 37
0
votes
1 answer

Espresso match selected spinner text

Following the answer here, I try to check whether a certain spinner text is selected. The spinner appears in a dialog, so I…
0
votes
1 answer

different testcase example for androidTest and test folder in android studio

Android studio is creating 2 folder androidTest and test. can anyone give example of testcases for both folders.
0
votes
1 answer

Android Instrumentation with a common file

I am new to Instrumentation in android. So please help me to achieve this - I have an android apk with classes and methods in it. I need to monitor the time execution of all methods and classes in it using a kind of script file or some file(I mean…
user5350286
0
votes
1 answer

Async Task - Android Instrumentaion Unit testing - Exception - Only thread created can update the asynctask

This is my Asnyc task class class EndpointsAsyncTask extends AsyncTask, Void, String> { private static MyApi myApiService = null; private Context context; private static final String TAG = "EndpointsAsyncTask"; …
dheeraj
  • 195
  • 2
  • 19
0
votes
1 answer

Unable to upgrade to a Dynatrace enabled apk

I have used the auto-instrumentor command on my Android apk file. auto-instrumentor.cmd apk prop It generated three new files: unsigned signed final Now I am able to use my app when I do a fresh install. But if…
0
votes
1 answer

android instrumentation: need to simulate a button click

The only issue is that the button resides in the com.android.systemui package, or so I imagine. It is the OK button that a user has to press in order to allow adb over USB. My touchscreen is dead, and I am controlling the phone through an USB mouse,…
kellogs
  • 2,837
  • 3
  • 38
  • 51
0
votes
1 answer

Mocking in InstrumentationTestCase

I try to mock a method in my instrumentation test but it fails and I am looking for a solution to solve it. public class MyTest extends InstrumentationTestCase { private Context mAppCtx; @Override public void setUp() throws Exception…
Ali
  • 9,800
  • 19
  • 72
  • 152
0
votes
1 answer

View Exception in test setUp() method with @UiThreadTest annotation

I'm running into an issue where I'm trying to alter the UI in my setUp() method. public class DrawerRootActivityTest extends android.test.ActivityInstrumentationTestCase2 { @UiThreadTest @Override protected void…
Kenny Wyland
  • 20,844
  • 26
  • 117
  • 229
0
votes
1 answer

AndroidJUnitRunner doesn't run tests in package

I'm able to run the instrumentation tests just if I specify the class. adb shell am instrument -w -e class com.application.instrumentation.BaseActivityTest…
0
votes
1 answer

Creating a new Handler on the main thread in ApplicationTestCase

In my Instrumentation Tests, I have a base class that extends ApplicationTestCase TestApplication extends Application and just does some basic init work in onCreate(). In one test suite, I am testing a class that instantiates a new…
AllDayAmazing
  • 2,383
  • 1
  • 24
  • 25