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

  • What is the use of startTest() and stopTest() method in Salesforce?

  • Aditya

    Member
    February 18, 2020 at 3:55 pm

    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 1 month ago by  Forcetalks.
    • This reply was modified 1 month 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.

Viewing 1 - 3 of 3 posts

Log in to reply.

Original Post
0 of 0 posts June 2018
Now