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
akhil Vakhil V 

101 soql in test class

hi,
How to over come 101 soql in test class?
ManojjenaManojjena
Hi Akhil,

Try to use Test.startTest() and Test.stopTest() in each test method .It will help .

 
akhil Vakhil V
Hi Manoj,

I wrote a test class which doesnt have single Query in that.Also am getting error as 101 soql 
Test method means ?
test.startTest();
statitc testmethod method1I(){
}
Tets.stopTest();
like this ?
ManojjenaManojjena
Hi Akhil ,

When ever you will insert a record from test class all trigger related to that object and event will fire and all SOQL inside trigger will consider .
You can create a debug log and check how many trigger got fire while executing test case .

Thnaks 
Manoj