Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9145797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:36:12+00:00 2026-06-17T10:36:12+00:00

I cannot get a trivial Robotium test running: public class TapsTest extends ActivityUnitTestCase<Ad> {

  • 0

I cannot get a trivial Robotium test running:

public class TapsTest extends ActivityUnitTestCase<Ad>  {
public TapsTest() { super(Ad.class); }

Solo mSolo;

@Override
protected void setUp() throws Exception {
    super.setUp();
    mSolo = new Solo(getInstrumentation(), getActivity());      
}

public void testTabTaps() {
    assertTrue(mSolo.searchText("Latest")); // NPE thrown here
   }
}

this test crashes consistently with

java.lang.RuntimeException: java.lang.NullPointerException
at com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:113)
at com.jayway.android.robotium.solo.Searcher.searchWithTimeoutFor(Searcher.java:68)
at com.jayway.android.robotium.solo.Solo.searchText(Solo.java:442)

on both my two devices (Android 4.1.0 and 4.0.3) and ADV. Initially Robotium complained about the missing V4 support library (we do not need it for other purposes) so I added android-support-v13.jar. Now the class not found exception is gone but NPE remains. I also tried to start the activity manually:

    Ad ado = startActivity(new Intent("android.intent.action.MAIN"), null, null);
    mSolo = new Solo(getInstrumentation(), ado);        

but NPE remains. I tried mSolo.searchButton("Go") and there is a button with this text on UI, and it is visible, and still the same NPE from the line 113 in Robotium.

The application itself starts and runs correctly if not under tests. Also, other ActivityUnitTestCase tests (without Robotium) run and pass without issues.

I tried to use robotium-solo-3.6.jar from Robotium website.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:36:13+00:00Added an answer on June 17, 2026 at 10:36 am

    Is there any reason, you use ActivityUnitTestCase?
    You should rather use ActivityInstrumentationTestCase2.
    Then you have to change your constructor – add package as parameter.
    Look here: http://code.google.com/p/robotium/wiki/Getting_Started

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I assume I am missing something trivial, but I cannot get jQuery tabs to
I must be missing something trivial with SQLAlchemy's cascade options because I cannot get
I am probably missing something really trivial here, but I cannot get phpunit to
cannot get the comments to show in actionscript file when running asdoc.. is this
It has to be trivial, but I just cannot get through it. I have
I cannot get my Wordpress theme to randomise the posts I'm displaying in the
I cannot get my Spring web app to find my scripts. I have the
I cannot get this function to fire off... I'm thinking I need a fresh
I cannot get my SID working ... <?php session_start(); // Or maybe pass along
I cannot get Bindable LINQ to work with VB.NET for the life of me.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.