Activity › Forums › Salesforce® Discussions › how to avoid mixed dml exception in Salesforce test class? Tagged: DML Exception, DML Statement, Salesforce Development, Test Class Salesforce® Discussions how to avoid mixed dml exception in Salesforce test class? Posted by Uday on November 8, 2017 at 5:46 AM how to avoid mixed dml exception in test class Nikita replied 8 years, 6 months ago 2 Members · 1 Reply DML ExceptionDML StatementSalesforce DevelopmentTest Class 1 Reply Nikita Member November 10, 2017 at 5:35 AM Hi Uday, Try using “Test.startTest()” and “Test.stopTest()”. These break unit test context into two contexts (inside startTest-stopTest and outside) Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me