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

Robotium. waitForActivity() returns false for embedded activity in TabHostActivity

I have a TabHostActivity that has 4 tabs (and 4 corresponding Activities). When in the test I click on one of them("Search") the SearchActivity should appear (and it actually does). The problem is that in Robotuim-test I try to wait for this…
Taras
  • 488
  • 6
  • 21
7
votes
1 answer

Check existence of a fragment using Robotium - Android

Is anyone aware of a way to check the existence of fragment using Robotium? Regards Rc
Rc N
  • 103
  • 3
  • 6
7
votes
1 answer

Robotium: Click on text in the alertDialog only, not in the underneath activity

I have an activity displaying some text, for example "someText". From this activity, I open an alert dialog box as follow: AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle("Title"); String[] items = {"Hello",…
Laurent D.
  • 449
  • 4
  • 19
7
votes
1 answer

How to inject click event with Android UiAutomation.injectInputEvent

I'm automating the testing of a flow in my app where I install a device administrator. To activate a device administrator on most devices (let's assume here I don't have some enterprise API that lets me do this like what Samsung offers) the system…
jargetz
  • 614
  • 9
  • 16
7
votes
1 answer

Create testing Android apk using gradle build system

I'm migrating my android project to gradle build system and I can't import my Android project from my Integration Test Android project. I'm using multi-project configuration with several android-libraries and it's working great, but I'm having a…
David
  • 496
  • 6
  • 8
7
votes
3 answers

Clicking on Action Bar Menu Items in Robotium

I'm trying to run some automated tests in Robotium. I have the following code in my application which sets up an options menu : public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) { com.actionbarsherlock.view.MenuInflater…
AndroidEnthusiast
  • 6,557
  • 10
  • 42
  • 56
7
votes
3 answers

Programmatically click on Android notification

I am black-box testing an application by using the Robotium framework. The app under test send a notification in the status bar each time I install a new application. I would like to click on that notification, but I still did not find a proper way…
7
votes
4 answers

can wifi be switched on/off in test case through robotium

can we switch on/off the wi-fi of the device in a test cases in robotium? because i am testing an issue which needs wifi to be on in initial phase then turning off the wi-fi and continue with testing.
Ryhot
  • 325
  • 4
  • 12
7
votes
2 answers

slow or fast drag up (scroll) using robotium

this my code for drag up current screen. int screenWidth = getActivity().getWindowManager().getDefaultDisplay().getWidth(); int screenHeight = getActivity().getWindowManager().getDefaultDisplay().getHeight(); int fromX, toX, fromY, toY = 0; fromX =…
VISHAL VIRADIA
  • 1,388
  • 1
  • 15
  • 34
6
votes
1 answer

Robotium: How do I wait for loading to complete before proceeding?

I want to write a Robotium/Junit test for an android app. At certain steps, I want my test to wait until the spinning loading symbol disappears off the screen. How can I do that?
user952342
  • 2,602
  • 7
  • 34
  • 54
6
votes
2 answers

Run Junit test using android instrumentation on a package with classes in specific order

I am trying to run android instrumentation Junit test using command line.I am using following command and it is launching the test right. adb shell am instrument -w com.android.foo/android.test.InstrumentationTestRunner My android project package…
Akhil Latta
  • 1,603
  • 1
  • 22
  • 37
6
votes
7 answers

Automated Acceptance Testing For iOS and Android Devices

I'm working on a web project where it has become clear that having some Selenium-type automated acceptance tests would be very helpful. But the project is a web site for mobile/handheld devices, not desktop browsers like what Selenium…
Trott
  • 66,479
  • 23
  • 173
  • 212
6
votes
2 answers

robotium testing wait time between each clicks

in robotium testing, is it possible to set a wait time between clicks? For example, I have 2 buttons(A & B). I want robotium to click on button A and then 20 seconds later click on button B.
xiaowoo
  • 2,248
  • 7
  • 34
  • 45
6
votes
1 answer

How to get the activity running from other process using Robotium

i have a main activity and when tap on the button in the main activity it moves to the another activity than runs on another process .. is there a chance to track/get that activity using robotium /by means of other codes to integrate with robotium
puli
  • 61
  • 2
6
votes
6 answers

Click on Link in robotium

How can I make Robotium click on a particular link in a page?
user608211
  • 61
  • 4
1 2
3
66 67