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
VishwanathVishwanath 

Problem with Test.starttest()

Hi,

 

I am wrting the test class in Unlimited edition sandbox , when i use Test.starttest() method it will gives error as

 

' Method does not exist or incorrect signature: test.starttest() at line ......'

 

Priveously it works fine, but know it displaying the above error..

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Prafull G.Prafull G.

Hi Vishwanath,

 

Do you have any class with name "Test" in your org's apex classes. If yes, please rename that to something else.

 

Let me know if this helps.

 

Regards

crmtech21

All Answers

Chamil MadusankaChamil Madusanka

Try

System.test.starttest();

 If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

VishwanathVishwanath

Hi Chamil,

Tanks for your responce,

 

i tried , it will save the code but the coverage is 0% ,

 

could u able to explain me why Test.starttest() is working previously and it is not working now..

and wat is the difference between Test.starttest() and System.Test.starttest()

 

 

 

Thanks

Prafull G.Prafull G.

Hi Vishwanath,

 

Do you have any class with name "Test" in your org's apex classes. If yes, please rename that to something else.

 

Let me know if this helps.

 

Regards

crmtech21

This was selected as the best answer
Chamil MadusankaChamil Madusanka

This change was happend after Winter 12' release. But salesforce has not clearly mentioned about this changes. I think the reason for this Salesforce has moved the Test class into System class as a Inner class.

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.