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

"Injecting to another application requires INJECT_EVENTS permission" error, in robotium test on android apk

I writed a robotium test that runs a test on a apk file. In this case i created the apk file in a previous android poroject, as the apk is still in a debug mode. the test clicks and inserts data in the app. as running it in emulator i get the error…
Zag Gol
  • 1,038
  • 1
  • 18
  • 43
3
votes
2 answers

Android: UI Collaboration (Jenkins+Spoon+?)

I really like the idea of automated testing for Android. I've tried Spoon, which gives great results for previewing current state of UI on different devices. The problem is how to effectively share it with the team (developers/UI/UX). What I want to…
surlac
  • 2,961
  • 2
  • 22
  • 31
3
votes
4 answers

Unlocking the emulator or device for Android test

I am writing Android functional tests. I need the device to be awake and the application to be visualized in order for them to work. I have consulted with Android developers for that. However, there are several problems with the proposed…
Boris Strandjev
  • 46,145
  • 15
  • 108
  • 135
3
votes
2 answers

Jenkins html publisher plugins showing old cached htmls - not the updated one

I have created a test job in jenkins and used html report publisher plugin to send the html report out puts (which is under project-root-directory/reports/htmls folder) back to the master server. As the test jobs rerun the html report out puts gets…
Som
  • 4,618
  • 4
  • 29
  • 32
3
votes
1 answer

Testing a Fragment's menu items that should appear in the ActionBar

In my app, clicking on a certain checkbox should enable a menu item on the action bar. This works correctly when I run the app manually. However, the automated JUnit/Robotium tests fail when checking for the menu item's view. Why do I see different…
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
3
votes
3 answers

False positives: junit.framework.AssertionFailedError: EditText is not found

I have a problem setting up Robotium tests to run on Travis without random false posivities. Every couple of builds I get pl.mg6.agrtt.TestActivityTests > testCanEnterTextAndPressButton[test(AVD) - 4.4.2] FAILED …
MaciejGórski
  • 22,187
  • 7
  • 70
  • 94
3
votes
1 answer

To generate the results of the Android JUnit test case once the test has finished running

I have an Android JUnit test case that uses Robotium to automate the entire functional flow of my android app. However, what i want is, once the test has finished running, I need to write the results to a text file, preferably to an excel sheet,…
veekay
  • 55
  • 4
3
votes
2 answers

Robotium: Wifi networks testing on Android Emulator

Is it possible to test wifi related tests on Android Emulator. That means in my application I have a scenario which will search a particular wifi network available and then connect to it entering password in the password field. Is it possible using…
Abhishek Swain
  • 1,054
  • 8
  • 28
3
votes
0 answers

Error: Test run failed: Instrumentation run failed due to 'java.lang.ClassNotFoundException

I'm trying to run simple testcase in eclipse, but I get next error: Android Launch! adb is running normally. Performing android.test.InstrumentationTestRunner JUnit launch Application already deployed. No need to reinstall. Launching instrumentation…
3
votes
2 answers

how to start "uiautomator test run" from android code?

Reference Links: Link1, Robotium Link2 as we know that from Robotium Link2, we can run robotium test run from android code. Now lets talk about uiautomator i already done following steps manually from Link1 adb push bin/AutomatedTests.jar…
VISHAL VIRADIA
  • 1,388
  • 1
  • 15
  • 34
3
votes
2 answers

Changing Android Apk Locale via Robotium

I'm working on an activity instrumentation test case which automates verification of an AUT using the Robotium framework. There are several language tests I want to automate. I've attempted to change language via Robotium by pulling the resources…
3
votes
3 answers

How to use R.id in robotium if I have only the apk file

I want to test an app from play market. I have a problem when I`m trying to use solo.clickOnView(solo.getView(cn.wps.moffice_eng.R.id.writer_edittoolbar_saveBtn)); cn - cn cannot be resolved to a variable How can i solve this poblem? As I…
user1835337
  • 656
  • 1
  • 9
  • 32
3
votes
0 answers

Putting and android app in background and bringing in it back to foreground for android testing

Im doing functional testing on Android application using Robotium. Trying to create a test case where 1. Activity starts, does some work. 2. Goes to background. 3. Another Activity sends and intent, brings it back to foreground. does some more…
mr.low
  • 448
  • 6
  • 17
3
votes
2 answers

Robotium for Android - solo.searchText () not working

I'm having a problem with searchText() function used with Robotium. I'm searching for this string: Service Activation Wizard (Step 2) I defined it in string xml, and I'm searching it this way:…
Flavio Capaccio
  • 706
  • 4
  • 15
3
votes
1 answer

Adding Robotium for all test projects

Every time while i test the application using Robotium , i need to navigate to test project properties and add it to the project,whenever i am configuring new test projects i need to add it every time is it there any other way to install Robotium…
Valamburi Nadhan
  • 229
  • 1
  • 2
  • 11