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

How to write test cases for the home screen activity using Robotium in Android

I am working on Robotium to write the test cases for one of the Android application. My requirement is to write the test suits for the lock screen and home screen with my test case. But I am unable to get home screen events and lock screen dragging…
Ganesh
  • 924
  • 2
  • 12
  • 34
3
votes
1 answer

How to write a test case method using Robotium in Android

I am writing a test case class for one of the activity in my application. That Activity class contains license checking for the application in android market and also displays the splash screen for 3 seconds. Here I would like to test that activity…
Ganesh
  • 924
  • 2
  • 12
  • 34
3
votes
1 answer

Robotium : Test two different activity in one test case

I just got started with Robotium and tried to test the android phone and contact application in just one test case. This is the scenario: 1- step Start the phone application – Dial a number(33323589) – wait (3s) – finish the call- Go back to the…
Chindji
  • 61
  • 5
3
votes
1 answer

How to keep activity running at the end of a test?

I am trying to write a test that performs a workflow in my app. However; I need to split my test into two parts. The scenario goes something like this: I start my app, then it starts a Gallery to select an image then goes back to my app to…
limmy
  • 73
  • 1
  • 7
3
votes
2 answers

Using Robotium when only having APK

I found Robotium for about one week ago, its a really nice tool. I an new in android testing and Java programming. Please I will like to know if there is any existing solution or example to make use of Robotium for pre-installed application…
Chindji
  • 61
  • 5
3
votes
3 answers

Access to Android device menu in Robotium framework

I would like to know is there any way to access to Android menu with help of Robotium framework? (http://code.google.com/p/robotium/) I want to programmatically select GPS activation line from menu. Is it possible with Robotium?
Artak
  • 31
  • 2
3
votes
1 answer

How to perform click on specific location on screen using Robotium?

I want to perform click on activity just some pixels say 30px above bottom of screen. It is not text, not button/ImageButton. Just a blank layout whose Id is unknown. How to do this. Please help.
Anuja Kothekar
  • 2,537
  • 2
  • 15
  • 28
3
votes
1 answer

How to change locale of android system automatically via code

I have apk file of the application undertest(no source code,is robotium UI automated-tests).I need to change system locale automatically via code. Could anyone give me a mechanism or way to solve this problem? Someone recommended me this…
Almett
  • 876
  • 2
  • 11
  • 34
3
votes
2 answers

How to run unit tests with all Android M permissions granted?

Is there a gradle plugin that allows adb commandline options when installing android apps? I'm looking to run robotium tests on an Android M device, while ignoring the permission dialogs that pop up that ask for camera, microphone, etc, permissions.
roy zhang
  • 191
  • 1
  • 9
3
votes
0 answers

How to test my current activity after intent with Robotium

I have tedious problem about Robotium. Normally While I test with robotium, if It is gone to SecondActivity by clicking a button in FirstActivity, Robotium can be checked that SecondActivity with assertCurrentActivity() method. For instance A…
Olkunmustafa
  • 3,103
  • 9
  • 42
  • 55
3
votes
1 answer

Robotium: Test run failed to complete. Expected N tests, received (N-1)

Android testing still remains my headache. I created the most simple app just to clear up how Robotium works, and each time tests fail with an error: Running tests Test running started Test failed to run to completion. Reason: 'Test run failed to…
shiryaeva
  • 75
  • 1
  • 8
3
votes
2 answers

Synchronization in Robotium

How long does robotium wait for a new activity to show up? Is it possible to set the timeout manually for the Solo instance?
Vicente
  • 232
  • 1
  • 10
3
votes
1 answer

Espresso how to search for text and if text is displayed click on it else continue test

I want to click on the app tutorial OK button which is displayed only for first time, In robotium this statement does this if(solo.searchText("OK")){ solo.clickOnText("OK"); }else{ //Do other things } If OK text is not…
Shivaraj Patil
  • 8,186
  • 4
  • 29
  • 56
3
votes
0 answers

How to get CPU usage of a particular android app using robotium or java scripts

I am currently automating android app UI using robotium. I would like to get the CPU usage value of my app in task manager in android using scripts. What is the piece of code I can use here
Aravindhan
  • 41
  • 2
3
votes
2 answers

Create screenshot of a Android 5.0 App with elevation

When i take a screenshot of my app (Material Design with Elevations), the shadow (elevation) is not in the saved screenshot-file. I try it with a real Device (Nexus 5) and with the google emulator. The screenshots looks fine but the shadows are not…
silly
  • 7,789
  • 2
  • 24
  • 37