简体   繁体   中英

Can no longer run individual instrumented tests in Android Studio

For two months or so now I haven't been able to run individual UI tests in Android Studio. Right clicking on the test name and then run <test name> just give me the error No tests were found . If I right click on the class name and then click run <testing class name> , it successfully runs all the tests in the class. So in order to just run an individual test in a class I have to resort to commenting out all the tests I don't want to run and then clicking on run from the class name which is a pain. This used to work fine a couple of months ago.

I really don't have much more information to go off of. The only output is

Connected to the target VM, address: '127.0.0.1:49178', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:49178', transport: 'socket'

Process finished with exit code 1
Class not found: "com.mypackagename.android.TestClassName"

Even years later (August 2022), same issue with latest Android Studio IDE;

In my experience, Android Studio 3.x was still able to run individual tests (no matter if individual-test-method or individual-test-class).

I will try updating Gradle, and report back if that helps;-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM