Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I am experiencing something weird on the Sandbox with all the test classes. whenever I run a test class I get the error: Method does not exist or incorrect signature: Test.startTest(). I am completely unfamiliar with this error and i don't know what happened because all these test classes are working just fine in production and where working just fine on Sandbox 2 days ago

I will appreciate any help!

Test class structure i am using:

@istest
private class ClonePlus_Test {

 static testmethod void testcloneplus () {
   ......

   Test.startTest();
   system.runAs(user){

     ......
   }
   Test.stopTest();

  }
}
share|improve this question

2 Answers 2

up vote 4 down vote accepted

There is a good chance you actually created a class somewhere called Test. Find it and delete it.

share|improve this answer
2  
You can't just nilly-willy delete a class, in case it's used somewhere. Careful analysis is important before you just go about deleting a class. I'd suggest renaming it, and try compiling to see what broke. –  sfdcfox Sep 4 at 20:16
    
dphil, this is affecting all the test classes. all my test class start with test_'ClaseName'. This is weird because the were working just fine 2 days ago –  Carlos Sep 4 at 21:04
    
Do you have any classes that is actually called Test? –  dphil Sep 4 at 21:07
    
i found it.. you guys where correct, i spent so many hours trying to find the issue. Thank you so much –  Carlos Sep 4 at 21:09
    
Just had the same problem a couple of days ago. Pain in the bum. There should be a set of reserved words and the platform shouldn't allow you to create classes with those names. –  Bachovski Sep 5 at 9:34

The most common cause I've seen when I get an unexplained method does not exist for a salesforce supplied class method, is that I or someone else created a class with the same name as the standard one.

Since Test would be a common name for a class someone created just to test something etc. I would try checking your org for that, and if it exists renaming it and trying again.

--KC

share|improve this answer
    
But this is affecting all the test classes. all my test class start with test_'ClaseName' –  Carlos Sep 4 at 21:02
    
i found it.. you guys where correct, i spent so many hours trying to find the issue. Thank you so much –  Carlos Sep 4 at 21:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.