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
2 answers

Wait for callback without blocking main thread

I am stuck and will be glad to get any help! I am writing tests for an android library. The task is to make some actions in an activity and check that library responds correctly. My problem is that my test finishes just after all actions in activity…
0
votes
1 answer

How to generate robotium test reports with spoon?

I am using robotium and spoon together, spoon generates the result in nice html with screenshots and log, but what I am trying to do is towards the end of the test I have some more checks to do in my application like checking file is created on the…
0
votes
1 answer

Examine the contents of a WebView

I am doing some instrumentation Unit testing of an Android application. I am trying to find a way to examine the contents of a WebView. Specifically I am looking for an example for a way to determine if an HTML table has a cell that contains a…
Andrew W.
  • 345
  • 6
  • 13
0
votes
1 answer

Android Studio + Gradle and AndroidTest res/raw

I have an Android app. And I want to write instrumentation tests. I want to put some specific files in the res/rawfolder for the test apk. I place them in the androidTest/src/res/raw folder and reference them in code with R.raw.file. However the app…
Tiago Veloso
  • 8,513
  • 17
  • 64
  • 85
0
votes
1 answer

Android instrumentation test: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com.google.common.base.Optional

Why do I get this exception, when I run an Android instrumentation test? 30416-30566/com.example.myapp I/TestRunner﹕ java.lang.RuntimeException: java.lang.NoClassDefFoundError: com.google.common.base.Optional at…
0
votes
1 answer

How to run spoon in only one device

I have the situation where the tests can't be run in 2 different devices at the same time. I need to keep the two devices attached for another reason. How can I execute "mvn spoon:run" and run the tests in only one device instead of all of…
kepa
  • 55
  • 5
0
votes
1 answer

How to configure an application with a guava dependency and Espresso

I have guava as an application dependency and using Espresso in the Instrumentation tests. Since Espresso comes with com.google.guava:guava:16.0, and I have guava in the application dependency, I have to handle a duplicated dependency issue. Jake…
Naoya Makino
  • 557
  • 2
  • 8
  • 24
0
votes
1 answer

ActivityInstrumentationTestCase2 cannot setup new test after activity transition

I am trying to test a button that start a new activity using only ActivityInstrumentationTestCase2 without Robotium, and it's working fine, but when I try to run the next test case, it's not able to start. Following what was explained in this…
0
votes
1 answer

Instrumentation test run failed

I would like to ask a general question, I am doing automation testing using robotium tool with the help of a tablet which is single processor. While performing some actions my test case is failing like INSTRUMENTATION TEST RUN FAILED DUE TO…
user3556209
-1
votes
1 answer

How to correctly insert ids to an apk through instrumentation?

I'm doing instrumentation on an apk to add more ids (like in R.id.name) and set id for a specific widget, but I noticed something interesting: If I set an existing id (by "existing" I mean it is declared in ids.xml before compilation) to the…
-1
votes
2 answers

Which is the best framework for instrumentation testing in android?

From my experience found that unit test have many limitations like initialisation of objects in the class to be tested. Is instrumentation test gain over unit test?
-1
votes
1 answer

Instrument an Android APK

How to instrument an Android APK when the source code is not available? I'm building a testing tool that uses an APK as input and I need to instrument the APK. Basically, I want to instrument all the occurrence of a specific function (e.g. foo) and…
z3g
  • 11
  • 1
  • 5
-1
votes
2 answers

How to let espresso tests fail for a specific condition

For my espresso tests, I am searching for a way to let all tests fail before they run, if a specific condition is not met. How can I achieve this?
-1
votes
1 answer

Android Studio Instrumentation Test: Determine If Private View Was Added To Parent

I have begin incorporating unit tests (junit 4.12) into my Android project. One scenario I have encountered is determining whether a view has been added correctly. For example in my ViewToTest class: private TextView _text; /** * Shows all text. …
Aggressor
  • 13,323
  • 24
  • 103
  • 182
-1
votes
3 answers

how to use Instrumentation under the uiautomator project?

I'm working on a uiautomator project recently and then the UiObject.getFromParent turn out a wrong element to me and I look into the source code of uiautomator and found out the answer is because by the UiSelector I used. I found that the…
1 2 3
35
36