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

How to click on soft keyboard 'search' button with Robotium test?

I want to test next thing with Robotium: enter some text in search field, this I did, and click on soft keyboard 'search' button (android:imeOptions=actionSearch) which I am failing to do. I tried with solo.sendKey(Solo.Enter) but no success. I am…
ezamur
  • 2,064
  • 2
  • 22
  • 39
5
votes
3 answers

Keyboard shortcut for Run As -> Android JUnit Test in Eclipse

Anybody figured out the keyboard equivalent of this menu? I have been using this menu on test cases infused with Robotium with class signatures like: public class AccountTest extends ActivityInstrumentationTestCase2 { ...…
Jonathan Schneider
  • 26,852
  • 13
  • 75
  • 99
4
votes
2 answers

Android testing using logcat for event capturing

I have been googling about this issue for hours, and I'm stumped. Im trying to write a comprehensive test suite for android devices, and my first idea was to validate test results using logcat output. Logcat has all the event info I need from both…
user1256607
  • 139
  • 3
  • 10
4
votes
2 answers

Uninstall application when testing

I'm new to testing in Android with Robotium. How can I programatically uninstall and then install the application before running some of the tests? For example, in order for me to test the login activity, I need to make sure the login credentials…
Catalin Morosan
  • 7,897
  • 11
  • 53
  • 73
4
votes
4 answers

How to resolve Exception during suite construction?

I have followed the below steps to test my app. I have created Android Project. I have created the debug signature for my sample app and test app(which need to be tested) Place the sampleapp_debug.apk in the bin folder (where my workspace is…
ChanGan
  • 4,254
  • 11
  • 74
  • 135
4
votes
4 answers

Android jUnit TestCase: When does the activity onCreate() actually get called?

I am fairly new to testing and am trying to explore jUnit Tests and Robotium. My application has 4 screens. Splash Screen --> Screen2--> Screen 3--> Autocomplete Screen. [init()] [ check values generated by init()…
rDroid
  • 4,875
  • 3
  • 25
  • 30
4
votes
1 answer

How to generate reports for Android Automation

I have a Robotium test cases that I would like to run nightly using automation tool, however I am not sure if it can be done without manually running it through Eclipse first. Is there a build script that would enable me to run the Robotium test…
Rahul Mendiratta
  • 615
  • 1
  • 6
  • 14
4
votes
3 answers

Why is Robotium slower when perfoming simple UI tasks in comparison with Android native code?

I'm using Robotium to do some simple UI tasks on my unit testing project. I noticed Solo being significantly slower, I dont know why. I'm new to it. This code is done with Robotium: solo.clearEditText(editTextLogin); …
kaneda
  • 5,981
  • 8
  • 48
  • 73
4
votes
1 answer

Robotium - How to set a date in date picker using Robotium

I have a date picker field where I want to set the dates (with a picker for Month, Day and Year with + and - for each field) but don't know how to do that in Robotium. I tried to use solo.setDatePicker(int, int, int, int), but the code complains…
Char
  • 61
  • 1
  • 4
4
votes
1 answer

Send Enter Key using robotium for Android testing?

I am using Robotium for android testing. I have a feature where if the user types into a edit text field and then presses the enter key he is taken to the next field. Now to test this in Robotium, I am able to insert text into the text field. But I…
Vinod
  • 31,933
  • 35
  • 96
  • 119
4
votes
2 answers

Android grant permission error

I got this error when i was going to grant CHANGE_CONFIGURATION permission to my application:(is Windows platform) CMD command line error is below: /$ pm grant packageName android.permission.CHANGE_CONFIGURATION > operation not allowed:…
Vincent
  • 61
  • 1
  • 6
4
votes
0 answers

how to solve Test run failed: Instrumentation run failed due to 'Native crash' in robotium

I am trying JUnit test but facing following issue. When I select Android JUnit Test by right clicking on Project it shows following message Test run failed: Instrumentation run failed due to 'Native crash' and when I right click on TestApk.java…
user2497880
4
votes
1 answer

Android Studio black box testing with Robotium

I'm trying to write a black box test for an application of which i only have the APK (no source code) using Robotium. The documentation is very poor and limited to Eclipse. I'm trying to figure out how to write this kind of tests on Android…
Crysis85
  • 345
  • 3
  • 17
4
votes
1 answer

Can't run Robotium on Android Studio with only APK

In the description of Robotium, it says it's able to test Android projects with just the APK. I am capable of doing this in Eclipse but I can't seem to do this in Android Studio. When taking the same code from Eclipse and using it in Android Studio,…
user3369427
  • 425
  • 6
  • 14
4
votes
0 answers

Android: Automating recycler view using Robotium

Can we automate RecyclerView using Robotium ? I need to identify all the items listed in RecyclerView, is it possible using Robotium?