Activity › Forums › Salesforce® Discussions › What is the use of Test.setPage() in Apex ? Salesforce® Discussions What is the use of Test.setPage() in Apex ? Posted by Anuj on September 18, 2020 at 12:49 PM What is the use of Test.setPage() in Apex ? Manish replied 5 years, 8 months ago 3 Members · 2 Replies 2 Replies Kirandeep Member September 18, 2020 at 2:48 PM Test.setPage() method is used to set the context to current page, normally used for testing the visual force controller in test classes. [adinserter block='9'] Manish Member September 18, 2020 at 3:20 PM Test.setPage() method is used to set the context to current page, normally used for testing the visual force controller in test classes. Log In to reply. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me