I've created a apex class in which I used current page name for some purpose.Now while creating a Test class for that I need to create a virtual visual Force page.So how to create that page in test class.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
You set the current page ref as the page you are testing.
PageReference pageRef = Page.success; Test.setCurrentPage(pageRef);