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
Muhammad Jawwad 16Muhammad Jawwad 16 

How do I write a test class for scheduler class having a flow?

public with sharing class ScheduleMyFlow implements Schedulable {

  public void execute(SchedulableContext sc) {
    //  calling a flow 
    new Flow.Interview.MyFlow(new Map<String,Object>()).start();

    
  }

}

 
VinayVinay (Salesforce Developers) 
Hi Muhammad,

You cannot write test class for schedule flow.  Check below limitation and vote for this feature.

https://ideas.salesforce.com/s/idea/a0B8W00000GdZFoUAN/possibility-to-write-test-class-for-a-autolaunched-flow-with-a-schedule-trigger

Please mark as Best Answer if above information was helpful.

Thanks,