Compile Error: Method does not exist or incorrect signature: Test.startTest()

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


Even though the other answers are correct, you can resolve the issue also by explicitly using the System namespace like this

System.Test.startTest();
System.Test.stopTest();

That will use the System Test class instead of your own Test class and prevent any clashes between the two.

This is useful when you cannot delete the existing Test class for good reason.


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