Activity › Forums › Salesforce® Discussions › How to cover PageReference from test class in Apex in Salesforce? Salesforce® Discussions How to cover PageReference from test class in Apex in Salesforce? Posted by Anjali on September 24, 2020 at 2:39 PM How to cover PageReference from test class in Apex in Salesforce? Deepak replied 5 years, 8 months ago 2 Members · 1 Reply 1 Reply Deepak Member September 24, 2020 at 5:33 PM Create TestFactory class with @isTest annotation to exclude from organization code size limit . @testSetup to create test records once in a method and use in every test method in the test class. Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me