Activity › Forums › Salesforce® Discussions › Can we write test class for a shedulable batch class in Salesforce? Tagged: Batch Class, Salesforce Test Class, Schedule Salesforce® Discussions Can we write test class for a shedulable batch class in Salesforce? Posted by Deepak on September 12, 2019 at 2:22 PM Can we write test class for a shedulable batch class in Salesforce? Piyush replied 6 years, 8 months ago 2 Members · 1 Reply Batch ClassSalesforce Test ClassSchedule 1 Reply Piyush Member September 13, 2019 at 2:42 AM Hi Deepak, Yes, We can write test class for a shedulable batch class in Salesforce:- For Example:- @isTest public class testScheduleBatch{ public static testmethod void first1(){ Test.startTest(); Datetime dt = Datetime.now().addMinutes(1); String CRON_EXP = '0 '+ dt.minute() + ' * ' + dt.day() + ' ' + dt.month() + ' ? ' + dt.year(); testScheduleBatch.SchedulerMethod('Sample_Heading', CRON_EXP, new ScheduleBatch () ); Test.stopTest(); } } Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me