function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Steve@RevitasSteve@Revitas 

Strange errors when unit testing in Sandbox (cs3)

I'm getting the following error when running unit tests in our sandbox instance:

 

line -1, column -1: Previous load of class failed: changepasswordcontroller

 

Anyone else getting this?

Best Answer chosen by Admin (Salesforce Developers) 
Steve@RevitasSteve@Revitas

Nevermind found the problem. Once I set the API version to 24.0 that fixed it.

 

No sure where this page/controller came from though....

All Answers

Steve@RevitasSteve@Revitas

Nevermind found the problem. Once I set the API version to 24.0 that fixed it.

 

No sure where this page/controller came from though....

This was selected as the best answer
David@ClosedwonDavid@Closedwon

What was your API version set to when you were getting the errors?

 

I noticed that version 24 (or maybe 23 as well? I haven't checked) has some new behavior regarding unit tests.  Namely, test methods are not automatically allowed to see data in the org outside of what the test itself has created.  In order to test with existing records, there are flags to explicitly set.

Jordan@BracketLabsJordan@BracketLabs

What about setting 'List Views' those can't be created via APEX in a test, so you have to query for 'existing' ones in the Org.

 

Are some of those created by default in every test run?

Harika ZillaHarika Zilla

Hi,

 

I have run into similar issue.I got error when running test class.

 

Error: line -1, column -1: Previous load of class failed: edp1|processor

 

Here "edp1|processor" is an installed package. I set the API version 24.0 to class,but this won't work.

 

Is there any way to resolve this problem?

 

Thanks,

Harika