Issue
If I want to run a single test sometimes by right clicking on the test then selecting run, the test results would show "No tests were found" with an error related to "Exception in thread "main" java.lang.NoClassDefFoundError".
I found this to only happen some times, why is this occurring?
Solution
I found the issue to be that when using the method of right clicking on a test then running it, Android Studio sometimes runs the Android UI Test as a unit test instead of a UI test. After looking into some comments this can occur if you have multiple nested directories in your androidTest directory.
To get around this you will have to go to the 'Edit Configurations.." in the current configuration dropdown:
Create a new 'Android Instrumented Test' and you should set the module to app, and the class to the path name of your ui test class. You can even choose the 'Method' option and provide a method within the class provided in the path.
Hope this helps. This was a very annoying bug in Android Studio that was taking time off of my testing.
Cheers!
Answered By - Derwrecked
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.