Activity › Forums › Salesforce® Discussions › What is the use of @testSetup method in test class in Salesforce? Salesforce® Discussions What is the use of @testSetup method in test class in Salesforce? Posted by Deepak on May 11, 2020 at 12:02 PM What is the use of @testSetup method in test class in Salesforce? Marziya replied 6 years ago 2 Members · 1 Reply 1 Reply Marziya Member May 11, 2020 at 12:59 PM Method marked with @TestSetUp annotation executes before any testMethod. Data created in this method doesn’t need to be created again and again, and it is by default available for all test methods. There can be only one setup method per test class. Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me