• Pamela Nicholas
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I am trying to write unit test to test a class dealing with cookies and it is complaining that is can't find the variable Page.

 

Code:

PageReference page = new Page.Login;
String zisession = '123';
Integer maxAge = 10000;
Cookie ziSessionCookie = new Cookie(ZoomSessionManager.ZISESSION_COOKIE_NAME, zisession, null, maxAge, false);
page.setCookies(new Cookie[]{ziSessionCookie});
Test.setCurrentPage(page);

 IDE Error:

Save error: Variable does not exist: Page.Login

 

I followed the examples provieded by SalesForce but that clearly does not work out:

http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_error_handling.htm

 

I should note that the test code is in a separate unit test class and the Page.Login does work fine in the destination class (ZoomSessionManager.cls), just doesn't exist in the unit test for some reason...

 

 

Any ideas what I might be doing wrong?

Thanks!