ー PupSoZeyDe ー
ー PupSoZeyDe ー

Reputation: 1392

Android studio "run" not showing up

I tried to run test following this tutorial: https://developer.android.com/training/testing/ui-testing/uiautomator-testing#java

As default, there was one test file:

MyApplication2\app\src\androidTest\java\com\example\myapplication\ExampleInstrumentedTest.kt

In the file, I can see "run" button when I click right mouse.

enter image description here

However, test file I created for the uiautomater tutorial, "ChangeTextBehaviorTest.java", on the file when I click right mouse, there is no "Run" button. So I cannnot run the test ...

MyApplication2\app\src\androidTest\java\com\example\myapplication\ChangeTextBehaviorTest.java

enter image description here

How can I solve this issue? Thanks for you help.

Upvotes: 2

Views: 1505

Answers (2)

Abhi
Abhi

Reputation: 329

Even though the question is now answered, I saw the same issue where I could not see the "run" button next to my instrumentation tests.

FIX: Ensure you are using the 'Debug' variant as the active build variant for the module you are testing (and the 'Release' variant).

Upvotes: 5

Prajwal Waingankar
Prajwal Waingankar

Reputation: 2710

you have not imported the correct dependency for @RunWith and others as you can see it is showing in red (error). Refer the default test file for the imports and use the same imports for your file as well.

Upvotes: 3

Related Questions