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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:45:26+00:00 2026-06-18T06:45:26+00:00

I’m testing my app’s Login with Robotium and I’m having some problems. I’ve got

  • 0

I’m testing my app’s Login with Robotium and I’m having some problems. I’ve got two different user types so I’ve made 3 tests. One for each type and another failed login. If I execute them individually they all success, but if I run all the test case it runs one, executes the tearDown(solo.finishOpenedActivities) and it doesn’t restart the activity to execute the other tests. So in the second test when I’m asking for a EditText it says that is not available.

Here is my code:

public class TestLogin extends ActivityInstrumentationTestCase2<MainActivity> {

private Solo solo;

public TestLogin() {
    super("com.truekke4.test", MainActivity.class);
}

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

@Override
public void tearDown() throws Exception {
    getActivity().logout();
    solo.finishOpenedActivities();
    super.tearDown();
}

public void testUsuarioDesconocido() {
    solo.clearEditText(0);
    solo.enterText(0, "usuario desconocido");
    solo.assertCurrentActivity("Error", MainActivity.class);
    solo.clickOnButton("OK");
    solo.clickOnButton("OK");
    solo.assertCurrentActivity("Error", MainActivity.class);
}

public void testUsuario() {
    solo.clearEditText(0);
    solo.enterText(0, "usuario");
    solo.clickOnButton("OK");
    solo.assertCurrentActivity("Error", InicioUsuarioActivity.class);
}

public void testEmpresa() {
    solo.clearEditText(0);
    solo.enterText(0, "empresa");
    solo.clickOnButton("OK");
    solo.assertCurrentActivity("Error", InicioPymeActivity.class);
}

}

I’ve got to restart the activity manually? Create and Intent and startActivity(intent)?

I don’t have to finish opened activities? Or I have to finish activities but restart them/it in setUp(). How Can I restart or create activities to make recognizeables for Robotium?

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-18T06:45:27+00:00Added an answer on June 18, 2026 at 6:45 am

    I believe your issue is being caused because you’re overriding the setUp() method from ActivityInstrumentationTestCase2 rather than using the Robotium method. In your test classes, Robotium looks for a method with the signature public void setUp() to configure its tests, which can get confusing, because it has the same name as the method that can be overridden. I’m not sure of exactly when or how often the protected setUp is called, but I know that the public one is the best place to initialize solo as Robotium is guaranteed to call it before each individual test. Try changing:

    @Override
    protected void setUp() throws Exception
    

    to:

    public void setUp() throws Exception
    

    with the same method body (but without the @Override annotation) and see if that allows you to run all your tests.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I've tracked down a weird MySQL problem to the two different ways I was
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
i got an object with contents of html markup in it, for example: string
I am writing an app with both english and french support. The app requests

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.