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

Checking dialog prompt with robotium - Need if statement if not

I am attempting to write a few testcases for automation using robotium. I believe my question is easy but I haven't found a solution yet. I have a dialog prompt ("OK") that is triggered only about 50% of the time. I want this test case to check if…
Will
  • 664
  • 7
  • 23
3
votes
3 answers

Robotium solo waitForCondition

I'm using the robotium. Today I ran into with little problem. After click on button application crosses to the next activity. I need wait for appearance some button. View am = solo.getView(R.id.btn_login); solo.waitForCondition(am.isShown(),…
ELEGANCE
  • 31
  • 1
  • 2
3
votes
0 answers

Robotium and Service Test

I have an Application which binds to a Service using #startService. The Service is a remote service, defined using AIDL. I want to write a Robotium 4.x Test which binds to a "Mock" Service which delivers some Test data so that I can control which…
Kitesurfer
  • 3,438
  • 2
  • 29
  • 47
3
votes
1 answer

How do you test an Android application across multiple processes?

I have the whole project for tablets with resources and already have bunch of test cases written in combination of Robotium, Android and JUnit APIs In a project which under testing is used special attribute for one of activities…
Henadzi Rabkin
  • 6,834
  • 3
  • 32
  • 39
3
votes
1 answer

How do i assert if soft keyboard is invoked when we tap on edit text

I wanted to know if there is a way in which we can assert if the soft keyboard is launched when we tap on edittext using robotium
srinivasv
  • 125
  • 8
3
votes
3 answers

How can I check in Robotium that the app has finished?

I'm trying to create a test method using Robotium to check if the Android application finishes after clicking on a button (in the code there is a call to finish() when the user taps on it). public void test_onclickExit_finish() { String…
Javi
  • 19,387
  • 30
  • 102
  • 135
3
votes
2 answers

does robotium support double touch?

Does "ROBOTIUM " support 2 finger touch? Actually i want to write a testcase in which the user taps and hold one button and clicks on another button using other finger. is that possible?
Ryhot
  • 325
  • 4
  • 12
3
votes
0 answers

How to elegantly wait for test case to finish after call to startInstrumentation

I have a set of apps, each with associated test case instrumentation. I'm launching the instrumentation programmatically from yet another "launcher" app (implemented as a service), using startInstrumentation() as in this example:…
koopa
  • 31
  • 2
3
votes
3 answers

how to create a robotium testsuite?

with the code below, the tests are not executed in the order I'd like. test_homescreen is executed before test_splashscreen. I'd like to specify the tests to run and their order of execution. I believe I need to create a testsuite, but I don't know…
Franck
  • 512
  • 1
  • 9
  • 16
3
votes
4 answers

How to properly mock HttpGet call on Android test

I've got an application that performs HTTP GET calls using HttpGet and I would like to mock the response in order to test different scenarios without having to setup any specific local server that would act like the remote one. The goal is to have…
greut
  • 4,305
  • 1
  • 30
  • 49
3
votes
2 answers

Can I determine if an activity has running AsyncTasks?

During many of my tests, my app is running AsyncTasks that access the database and cannot be cancelled. At the end of my tests, I close my database, delete it, then reopen it so I have a fresh database fixture. The problem is that when the…
Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246
3
votes
3 answers

How can I ensure an AsyncTask is completed before my activity is killed?

I'm getting an Unable to destroy activity xxx: android.database.sqlite.SQLiteException: unable to close due to unfinalised statements error while my activity is being destroyed. I presume this is because I'm performing database operations from…
Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246