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

How to click on a button, which is indexed at 10 position in ListView - Robotium automation?

Suppose, I have a ListView, which contains 20 ListItems. Each item is having a button, now I want to click a button which is located at 10 position in ListView. How I can automate it via robotium?
user1667968
  • 1,489
  • 3
  • 12
  • 16
4
votes
2 answers

Robotium ClickOnButton(int ID) method causes "junit.framework.AssertionFailedError: Button with index 2131034130 is not available!"

I am using robotium for testing and can't figure out how to click buttons without text. Test fails with trace: junit.framework.AssertionFailedError: Button with index 2131034130 is not available!
insomniac
  • 379
  • 5
  • 7
4
votes
1 answer

Can a command from monkey runner be used in robotium?

I have written a script in robotium which works just fine, but our application is designed in such a way that it has to interact with the Native android application which cannot be resigned. I have to click a button on the native app which cant be…
nandish shetty
  • 71
  • 1
  • 1
  • 7
4
votes
2 answers

In Robotium, Click on QuickAction icons

Can any body tell that me how to click on the quick action icon [ buttons visible on screen with icon only- and without text labels ] in robotium. I need to automate some test cases, But i am not able automate that how to click on the quick action…
4
votes
2 answers

two robotium test case, but the second hang there not responding(in JUnit View)

I managed to write two test cases in my XXTest.java with robotium-solo-3.2.1.jar included, luckily in JUnit view it shows the first one is done, which the device exactly worked (on emulator too). Then it proceed to the second one, but it just…
Robert
  • 1,660
  • 22
  • 39
3
votes
3 answers

Robotium_constructor deprecated message at NotepadTest method for super

I am trying to write a sample test for notepad application. In the following code , I get a warning and I'm unable to run the test. Please help me resolve this. The warning says "The constructor ActivityInstrumentationTestCase2(String,…
srinivasv
  • 125
  • 8
3
votes
1 answer

Robotium: HowTo create a test project for an existing project in Intellij IDEA?

I'm stuck in creating a test project for an existing one. For Eclipse it was simple, but for IntelliJ(and I'm forced to use it at my workplace) I don't really know how to test the project using Robotium framework. I would appreciate if anyone can…
noTest
  • 159
  • 1
  • 3
  • 12
3
votes
3 answers

How to handle external application activity in android using robotium

I am trying to automate android app(Relocation services)using robotium. In this app there are media section and email and phone native dialer options so when i click on any of this option(Video, audio, phone, email) it takes you to the native…
user1153567
  • 57
  • 1
  • 5
3
votes
1 answer

Robotium test cannot find activity class

I have been using robotium to test my android application. I found it very useful tool so far. Recently we have done a refactoring that would use only one activity in the entire application, each page will be replaced by a fragment. However, After…
eric
  • 73
  • 5
3
votes
1 answer

force android tests to run on different emulators from command line batch file

How can I run my android junit/robotium tests from the command line on every single emulator? I want to make sure my tests run on many android OS versions and many screen resolutions. I'd like to write a batch file that runs from the windows command…
user952342
  • 2,602
  • 7
  • 34
  • 54
3
votes
3 answers

could not be found or has no tests in Junit

I am trying to test setting application using JunitTestcase.My class extends ActivityInstrumentationTestCase2. But while executing I am getting this error: 01-12 17:22:11.519: WARN/TestGrouping(2942): Invalid Package: '' could not be found or…
V I J E S H
  • 93
  • 1
  • 6
3
votes
1 answer

How to run android testapp using robotium on android device(commercial phone)

I execute several android testapps on an emulator, but I am really confused how to run testapp on a commercial phone. If any detailed steps mentioned in any of the site please publish the links ..... Really need it. Thanks in advance. Congrats to…
Manidhar
  • 51
  • 3
3
votes
1 answer

replace singleton instance in a running roboguice application

I have an android application using roboguice as a dependency injection framework. There are several singleton services defined, which are used in the application as well in activities. My problem is that we have a robotium test, which testing the…
alosdev
  • 384
  • 2
  • 14
3
votes
1 answer

Android & Robotium - Testing that a fragment shows up?

In my android application (Tablet) I want to verify that after selecting a button the fragment appears on the screen. Is there a way to do this?
aryaxt
  • 76,198
  • 92
  • 293
  • 442
3
votes
1 answer

Can't get my assert current activity to work

I have 2 activities, the first one is the startup one which in it's create method causes the second one to be launched, always. My Robolectric tests pass fine Activity public class LoginActivity extends Activity { /** Called when the activity is…
MayoMan
  • 4,757
  • 10
  • 53
  • 85