“Could not run tests on class …”

Today, I am writing test code in my Sandbox, and until 15 minutes ago, my test execution was working. Now, all of a sudden, my tests stopped working. I can’t run even a single test!

Test execution says: Could not run tests on class 01pc00000005VHc (or whatever the Id is of the test I’m trying to run).

I found this post describing the same issue with Winter ’14 API:
http://boards.developerforce.com/t5/Apex-Code-Development/Running-testMethods-Could-not-run-tests-on-class-ID/td-p/677209

I tried changing the version of my test code back to version 28.0 as well as only having one testMethod in my test class, but nothing solved my issue. I can’t run any test code!!!

Any ideas? Many will be much appreciative!

Answer

This is happening for me both on cs18 and cs17. Seemingly random changes allow the test classes to run. Actually they always run, they just report this error anyway. I haven’t found a set of random changes that allow the classes to run and for the code to work. For example, if I reference Trigger.new from one of my custom triggers I get the error from any test class that ends up invoking that trigger…

I finally checked the box “Store Only Aggregated Code Coverage” and that seemed to resolved the issue. It is not like salesforce has ever actually reported the correct lines in the coverage results, so there is no real loss here.

Attribution
Source : Link , Question Author : Scott Pelak , Answer Author : user4360

Leave a Comment