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
4
votes
3 answers

enabling Robotium in Android

I recently decided to switch from Eclipse to Android Studio. While i was able to import my android project, i keep having problems setting up and transfering my unit tests. For testing purposes i made a directory in src folder (java folder and test…
aphelion
  • 561
  • 1
  • 5
  • 12
4
votes
0 answers

Android testing: verify the method was actually called

I have the following code in my activity: @Override protected void onResume() { super.onResume(); initLoaders(); } How can I test this code using Robotium/Espresso or may be any other testing tools? I want to verify that initLoaders gets…
netimen
  • 4,199
  • 6
  • 41
  • 65
4
votes
0 answers

How to get the color from a GradientDrawable?

I have an EditText with the background defined in a xml file:
Daniane
  • 41
  • 1
  • 3
4
votes
2 answers

Android Instrumentation HOME button

Any idea why sending the HOME key to an application running under Instrumentation does nothing? import android.app.Instrumentation; import android.view.KeyEvent; public class MyInstrumentation extends Instrumentation { public void sendKeys() { …
4
votes
1 answer

"Test failed to run to completion. Reason: 'Instrumentation run failed due to 'Process crashed.'' while running multiple testcases

I wrote a test project for testing an android application(Application Under Test is my own project). I get the following failure in console as well as in Junit View. Test failed to run to completion. Reason: 'Instrumentation run failed due to…
Bhupesh
  • 477
  • 1
  • 8
  • 22
4
votes
1 answer

Spoon + TeamCity

I want to test my app using Spoon + TeamCity. TeamCity is a remote server, is it possible to get access to android devices to run Spoon tests from TeamCity? Has anybody faced this problem?
ADK
  • 513
  • 3
  • 8
  • 22
4
votes
0 answers

Test run failed: Instrumentation run failed due to 'keyDispatchingTimedOut' ; Robotium

I'm new in Robotium. When I run my test cases I get the following error: Test run failed: Instrumentation run failed due to 'keyDispatchingTimedOut'. My TestCase code: public void testRun_4() { // Wait for activity:…
MrAnadole
  • 51
  • 1
  • 5
4
votes
2 answers

Correct way to open NavigationDrawer and select items in Robotium

What is the correct way to open NavigationDrawer and select items from the navigation list in Robotium 5.1? I tried solo.setNavigationDrawer(Solo.OPENED); clickInList(position); yet they're not working.
Mahmoud Abou-Eita
  • 933
  • 1
  • 8
  • 17
4
votes
0 answers

Robotium - Chose an account in AccoutPicker with solo

I call a new choose Accout Activity with: Intent i = credencial.newChooseAccountIntent(); startActivityForResult(i, REQUEST_CHOOSE_ACCOUNT); And now I want to test my app with robotium. The first step is to choose an account int the choose account…
alex_pt
  • 340
  • 1
  • 3
  • 10
4
votes
1 answer

Android gradle instrument test module doesn't see sources from main project

For last few days I am struggling with setting up a separate test module in gradle for Android project. I found how I can set up instrumentation tests inside my main project under instrumentationTest directory but I can't find a way how to do this…
4
votes
3 answers

(Robotium) Action bar up/home button click

I use Robotium as the library for Junit test for my Android application. I wrote some tests which works well. But when I try to write a test for native ActionBar's Up/Home button click, it failed. My test code is very simple: Solo solo = new…
Mellon
  • 37,586
  • 78
  • 186
  • 264
4
votes
1 answer

(Robotium) How to select a RadioButton in a RadioGroup

In my Android app view layout, I have a which contains two :
Mellon
  • 37,586
  • 78
  • 186
  • 264
4
votes
6 answers

how to find main activity in apk file for robotium tests

I have a lot of apk files and I want to write simple tests with robotium for them. I have some problems, when I tried to find Main Activitys for them, in Dropbox app as example. In AndroidManifest.xml i found this:
user1835337
  • 656
  • 1
  • 9
  • 32
4
votes
2 answers

Where can I get a list of all of the Robotium commands?

Where can I get all Robotium commands? (*waitForView*, *appBar*, clickExit*... all of them) I searched the web and couldn't find a complete listing anywhere.
Sam
  • 900
  • 10
  • 18
4
votes
1 answer

Robotium with Mockito or Easy Mock

I'm new to Android testing and I`d really appreciate if some of you could help me with that. I'm using robotium as automation testing framework (so far so good), but I have no idea how I use mockito or Easy Mock to add some mocks to my tests. I'm…