I have to write a test class for a Process Builder which sends a notification to user at certain time which is equal to a date and time field (scheduled Date and Time)in Opportunity so there is a scheduled action which will trigger the notification at that scheduled Date and Time so how can I cover all the elements after that scheduled action.

I have tried Using below code but it's not working

DateTime start = System.Now();

while(System.Now().getTime()< start.getTime()+2000){}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy