Questions tagged [robotium]

Robotium is an Android test automation framework that has full support for native and hybrid applications. Robotium makes it easy to write powerful and robust automatic black-box UI tests for Android applications. With the support of Robotium, test case developers can write function, system and user acceptance test scenarios, spanning multiple Android activities.

Robotium is a test framework that allows to implement white-box test cases for native Android applications. It supports black-box testing too (i.e. without source code and only when the apk file is available) as long as the apk file and the test project are signed with the same certificate signature.
To achieve this it might be required to resign the apk file. Consequently pre-installed applications can be tested on rooted phones as well.

The Robotium main class, Solo, provides methods to click or tap on a number of views identified by id, index or containing text strings, e.g.:

Solo solo = new Solo(getInstrumentation(), getActivity());
solo.clickOnText("Release rabit"); // Click on some text
solo.clickOnButton("Ok");          // Click on confirmation button

It also allows to assert that some message is currently displayed by GUI:

// Assert message is displayed
assertTrue(solo.searchText("Rabit is on the field")); 

It also provides methods to send key events, capture screen shots, wait for the named activity to appear and others.

993 questions
12
votes
7 answers

Robotium. In the suite of tests each next test is affected by the previous test

I have multiple UI tests. When I run a single test, everything is OK. But if I run a batch of them (as a part of CI build) test fail, because tests that go first change the state of the application, and the next tests are affected by those changes.…
Taras
  • 488
  • 6
  • 21
12
votes
1 answer

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 it This is my build.gradle file buildscript { dependencies { repositories { mavenCentral() mavenLocal() …
MariusBudin
  • 1,277
  • 1
  • 10
  • 21
11
votes
1 answer

How to do Integration Testing on Android with the new Gradle Build System?

Our Android app needs automated testing, and our group is using Robotium to handle that for us. This is no problem for unit tests, but we're also writing a set of end-to-end integration tests to exercise not only the client by the back-end servers…
Argyle
  • 3,324
  • 25
  • 44
11
votes
3 answers

Android: Robotium vs android test framework

Everyone using Robotium for GUI testing. Can you tell me what Android native test framework cannot do that Robotium can do? As I know Robotium can be used as black box testing, so I do not need to know about application resources. What else?
Jim
  • 8,874
  • 16
  • 68
  • 125
10
votes
2 answers

Existing Android UI tests stopped working after switching to AndroidJUnitRunner

We have a few UI tests around our camera functionality, and after we made the switch from InstrumentationTestRunner to AndroidJUnitRunner as part of our move to Espresso/JUnit4, we can no longer run our existing tests reliably due to frequent…
Yenchi
  • 2,076
  • 24
  • 30
10
votes
3 answers

How to find out which Activity is on top of the stack using Robotium/Android SDK?

I have a Robotium test for an Android application, which extends ActivityInstrumentationTestCase2. The test operates on a loop, randomly clicking on active views. I would like to verify at the start of each iteration which Activity is currently…
Paulo Barros
  • 2,740
  • 8
  • 28
  • 36
10
votes
2 answers

How to select which button to click on Robotium for an alert dialog?

I am new to Robotium. I have created an alert dialog box using dialog builder and called it using the show command. I was able to trigger the 'ok' button by default using Robotium and I am not able to do the same for the 'cancel' button. As the…
Kavin Arasu
  • 103
  • 1
  • 5
9
votes
2 answers

Attempt to invoke interface method on a null object reference finishComposingText()

I am running robotium on a nexus 6 and getting the following error java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.view.inputmethod.InputConnection.finishComposingText()' on a null object reference at…
FriendlyMikhail
  • 2,857
  • 23
  • 39
9
votes
5 answers

Examples for Robotium

I found a tool for Instrumentation Testing called Robotium.It is easy and simple for black box testing of android applications. We can use it as follows: solo.clickOnText("Other"); solo.clickOnButton("Edit"); …
siri
  • 91
  • 1
  • 1
  • 2
8
votes
4 answers

Android test annotations with Robotium

I'm currently building an app in Android, and using Robotium to do functional tests (By the way, don't use Robotium on anything less that Android 1.6, it is way too buggy). Some of these tests have a random tendency to fail, mainly Robotium missing…
8
votes
0 answers

Could not launch Intent within 45 seconds - robotium

I'm facing a big problem which I've been trying to solve for a few days. I am trying to run a test using robotium but when I call getActivity() on the setup method, a RuntimeException exception is thrown. java.lang.RuntimeException: Could not…
Benjo
  • 133
  • 1
  • 9
8
votes
3 answers

Why do I get a NoClassDefFoundError when running my test on an ActionBarActivity?

So I am using Robotium and my test class is extending the ActivityInstrumentationTestCase2 class. I have imported the v7 support library in my main project and also in the test project as libraries. Now what I don't understand is that the test…
8
votes
1 answer

Interface Android robotium testing with Teamcity

As this was not answered (Maybe did I not find it) previously, I investigated on the following question : How to perform automated functional tests on Android devices with robotium, and report them to continuous integration server like TeamCity?
Al_th
  • 1,174
  • 1
  • 12
  • 24
7
votes
3 answers

How to run Android/ Robotium Instrumentation test cases against a release version APK?

I have an Android project setup with its pure Java unit test project running on PC, and its functional/ integration test projects running on Emulator. Those two make use of InstrumentationTestCase2 test cases and also Robotium framework. I'm able to…
superjos
  • 12,189
  • 6
  • 89
  • 134
7
votes
2 answers

Installing an Android apk programmatically as part of a test framework

I'm attempting to install an apk programmatically, but I'm not having much luck. I'm setting up an automated test framework targeting physical devices, and I want to have the test devices retrieve the latest apk from the build server before running…
Sam
  • 1,569
  • 3
  • 15
  • 24
1
2
3
66 67