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
5
votes
1 answer

Use both InstrumentationTestRunner and AndroidJUnitRunner with Robotium and Espresso

We're using Robotium with the android.test.InstrumentationTestRunner for our tests. Nevertheless we want to replace Robotium for Espresso, but we still have some doubts about it, since we have a machine with Jenkins for the CI. Espresso uses the…
noloman
  • 11,411
  • 20
  • 82
  • 129
5
votes
0 answers

Android Espresso testing app flow

I use Espresso to test a lot of activities and transitions between them. I want to write different test for those activities and link the Activity Intents to the corresponding test cases. 1 . Activity A (testActivityA runs) 2. ActivityA launches…
5
votes
2 answers

Continue Android tests after an exception

When running my test suite in Android Studio, occasionally there will be an exception thrown from somewhere in my code (not in the test) which will cause the current test to fail (good because the test has found a bug) and the rest of the tests to…
Kage
  • 765
  • 1
  • 8
  • 27
5
votes
0 answers

Robotium gradle-based Android Studio

I'm struggling to get Robotium to work on the gradle-based Android Studio and I can't find the way to run the test with gradle CLI. I Placed robotium.jar "robotium-solo-5.4.1.jar" into the libs folder, Added as library. In the src folder I created…
user4974298
5
votes
1 answer

ChooserActivity is not found with Robotium testing while ChooserActivity is showing on Nexus 5

I start developing a Android Project. I am writing testsuites. I want to test showing ChooserActivity. When I used a LG g2 tests are passed. However When I used a Nexus 5 (Lollipop) tests are failed. Code is as following: public void testRun() { …
5
votes
0 answers

I can't find the text in a pop-up Window using Robotium

I have been using Robotium for the last couple weeks writing test cases for an app. It's a great tool but there is one thing that I cannot seem to get working. The app I'm using creates a pop-up window regardless if you are in the app or not to…
ZeroInputCtrl
  • 169
  • 1
  • 8
5
votes
1 answer

Unable to clickon actionbar on robotium

Hi I am new to robotium and currently testing android "actionbaritems" in my application, i used the following code , assertTrue(solo.searchText("Log In";)); solo.clickOnButton("Log In";); solo.waitForActivity(LAUNCHER_ACTIVITY_FULL_CLASSNAME);…
Valamburi Nadhan
  • 229
  • 1
  • 2
  • 11
5
votes
4 answers

How to automatically test onResume behaviour by calling onDestroy using Robotium?

I am using Robotium to functionally test an Android app. I'd like to test the onResume behaviour after onDestroy has been called. This post hints on using Instrumentation, but i can't get it to work. I have included the following, but this fails…
Bram
  • 101
  • 1
  • 6
5
votes
2 answers

Is tearDown() supposed to run after each test?

I thought the tearDown() is supposed to run after each test, but what I see from logs is that it is started just after setUp() method. Can you guys clarify? public class LaunchManagerActivityTest extends…
Eugene
  • 59,186
  • 91
  • 226
  • 333
5
votes
2 answers

How to start Instrumentation project programmatically using Android Intent?

one way to start testcase is, adb shell am instrument -w com.google.vishal.test/android.test.InstrumentationTestRunner i want to start this using Android code (with intent) for example, adb shell am start -n…
5
votes
2 answers

Test suite construction failed -(android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests). How to resolve?

I'm new to Android application testing.I created an automation framework using java code. Then I tried to integrate the framework with the existing Robotium Test App. But then when i give Run as--> Android Junit,the test app gets installed…
5
votes
1 answer

flow from setup to teardown in robotium

what is the flow of the program in robotium.I mean are setup() and teardown() called for every testcase separately ?? option 1 setup() TC01 teardown() setup() TC02 teardown() or option2 setup() TC01 TC02 TC03 teardown()
Ryhot
  • 325
  • 4
  • 12
5
votes
1 answer

Java Robotium Android - Run same test simultaneosly on two different devices

I want to run an Android Robotium test on two devices simultaneosly. I couldn't find any solution by now... To be more precise, I have an application-test.apk wich contains multiple instrumentation classes. I want to run the same test apk, but…
Test123
  • 51
  • 3
5
votes
1 answer

Robotium Tests not running on Jenkins but local

i try to integrate my Robotium Tests on our Jenkins Server. I implemented an android Test Project that based on our app Project. Everything works like a charm when i run the Tests on my local Machine on Windows out of Eclipse and also by calling…
5
votes
2 answers

Can I truly enable and disable network access mid-test?

I want to write automated tests to run on the emulator that verify that my app behaves correctly when the network connection is spontaneously dropped. To do so, I'd like to write tests like the following: Enable network connection. Start some app…
Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246