Activity Forums Salesforce® Discussions What is the use of startTest() and stopTest() method in Salesforce?

  • Shubham

    Member
    February 18, 2020 at 5:06 pm

    Hi Aditya,

    startTest() and Test. stopTest()denotes the start and end of the test cases that we want t check in our code their job is to primarily allow us to reset the governor limits within the context of your test execution and to be able to test asynchronous methods. These two statements cannot be called more than once within a testMethod.

     

     

    • This reply was modified 4 years, 10 months ago by  Forcetalks.
    • This reply was modified 4 years, 10 months ago by  Forcetalks.
  • Ratnesh

    Member
    February 19, 2020 at 1:35 pm

    The Test.startTest method marks the point in your test code when your test actually begins.

    The Test.stopTest method marks the point in your test code when your test ends.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos