Activity Forums Salesforce® Discussions What is test.isrunningtest() usage in apex class in Salesforce?

  • What is test.isrunningtest() usage in apex class in Salesforce?

    Posted by Anuj on May 5, 2020 at 1:35 PM

    What is test.isrunningtest() usage in apex class in Salesforce?

    Marziya replied 6 years ago 2 Members · 1 Reply
  • 1 Reply
  • Marziya

    Member
    May 5, 2020 at 2:10 PM

    The Test.isRunningTest() method is used to identify, if the piece of code being executed is invoked from a Test class execution or from other artefacts such as a Trigger, Bacth Job etc. Returns true if the code being executed is invoked from a test class otherwise returns a false.

Log In to reply.