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 8097563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:48:09+00:00 2026-06-05T21:48:09+00:00

When I run a test with Robotium, I use an assertion to verify that

  • 0

When I run a test with Robotium, I use an assertion to verify that there is specific text on the page, but it fails. However, when I run the test without the assertion, the test passes. Why would this be?

Here is my code:

import com.jayway.android.robotium.solo.Solo;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.Smoke;

@SuppressWarnings("unchecked")
public class ODPRobotiumTest extends ActivityInstrumentationTestCase2 {

    private static final String TARGET_PACKAGE_ID = "com.gravitymobile.app.hornbill";
    private static final String LAUNCHER_ACTIVITY_FULL_CLASSNAME = "com.vzw.odp.LaunchActivity";

    private static Class<?>launcherActivityClass;

    static{
        try{
            launcherActivityClass = Class.forName(LAUNCHER_ACTIVITY_FULL_CLASSNAME);
        } catch (ClassNotFoundException e){
            throw new RuntimeException(e);
        }
    }

    @SuppressWarnings({ "unchecked", "deprecation" })
    public ODPRobotiumTest() throws ClassNotFoundException{
        super(TARGET_PACKAGE_ID, launcherActivityClass);
    }

    private Solo solo;

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

    @Smoke
    public void testLine1(){

        try {
            assertTrue(solo.searchText("Easy to Find")) ;
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }


    }
    @Smoke
    public void testLine2(){


            try{
        solo.searchText("Hassle-Free");
            }catch(Exception e){
                e.printStackTrace();
            }

    }
    @Smoke
    public void testLine3(){




        solo.searchText("Trust");


    }
    public void testLine4(){

        solo.searchText("Verizon Curated Wallpaper");


    }
    public void testLine5(){

        solo.searchText("Taco's");

    }
    @Override
    public void tearDown() throws Exception{
        try{
            solo.finalize();
        }catch(Throwable e){
            e.printStackTrace();
        }
        getActivity().finish();
        super.tearDown();
    }
}

The test in testLine1 is the test that fails. But like I said before, when I don’t use the assertTrue, and just solo.searchTest(“Easy to find”), the test will pass. I don’t understand.

Thanks for any help!

  • 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-05T21:48:10+00:00Added an answer on June 5, 2026 at 9:48 pm

    I just found out the content that I am trying to verify is HTML. So since Robotium doesn’t work with HTML, or any other web component, it won’t verify the text I’m looking for.

    Thank you to all who offered help!

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

Sidebar

Related Questions

I have a Robotium test suite that I am trying to run and for
i like to run test cases from the command line but there is a
I have a Robotium test cases that I would like to run nightly using
I run test cases from maven, that is from command line. Is there a
I am trying to run test on my server but it fails due to
Sometimes I see people use http://codepad.org as a way to quickly run/test their Perl
Although I can run test.cgi from the same location but app.cgi gives Internal Server
Although I can run test.cgi fine but my perl all doesn't work, is this
I'm using Robotium for some test automation for an Android application. It's great, but
I have one file /tmp/test.txt this is test that is test When I run

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.