Matt Logan
Matt Logan

Reputation: 5926

Where can I view JUnit test results in Android Studio?

I have a simple test class:

public class SimpleTest extends AndroidTestCase {

    public void testSomething() throws Throwable {
         Assert.assertEquals(1 + 1, 2);
    }
}

I know how to run the test, but where can I view the output in Android Studio?

Upvotes: 8

Views: 6935

Answers (4)

Sergio
Sergio

Reputation: 788

Late answer but it could be helpful.

I have Android Studio Electric Eel | 2022.1.1 and you just need to click on two different options just to show all nested results.

enter image description here

If you click on these two options, it will show all the results.

Upvotes: 1

Fahima Mokhtari
Fahima Mokhtari

Reputation: 2062

First of all, go to "Run" in the menu list in Android Studio, then click on "Run", a popup menu shows up, select from it which test you wish to run. Once you run it, you'll have the figure as shown in the attached screenshot: green progressbar means tests were successful, red progressbar indicates at least one of tests failed.For more details, visit android developers website here

enter image description here

Upvotes: 0

Martin Rončka
Martin Rončka

Reputation: 323

I was struggling with finding it at first, but eventually, I have managed to find it within the Debug window, under the Console tab.

enter image description here

It shows both progress (status bar) and test results (print within the console).

Upvotes: 1

flx
flx

Reputation: 14226

Run the test by right clicking on it.

enter image description here

The run tab should pop up, you can open it by hand on the very bottom left corner.

enter image description here

It will list your test results.

Upvotes: 8

Related Questions