nerdexam
Salesforce

PDII · Question #214

PDII Question #214: Real Exam Question with Answer & Explanation

The correct answer is A. Use Test.setCurrentPage(Page.MyTestPage);. See the full explanation below for the reasoning.

Question

What is the best practice to initialize a Visualforce page in a test class?

Options

  • AUse Test.setCurrentPage(Page.MyTestPage);
  • BUse controller.currentPage.setPage(MyTestPage);
  • CUse Test.setCurrentPage.MyTestPage;
  • DUse Test.currentPage.getParameters.put(MyTestPage);

Community Discussion

No community discussion yet for this question.

Full PDII Practice