+ Start a Discussion
ankitha varraankitha varra 

How to test the site.login(username, password, startUrl) in salesforce

  there  is a scenario there i want to test site.login(username,password,starturl)  in salesforce
Rito SarkarRito Sarkar
as this method returns a pagereference, ithink this will do, u can test any method of pageReference return type using this.

private class testLogin{
//this is mandatory declaration
private static Pagereference newPage;
//this declaration is optional
private static yourclass variableofClasstype;

private static testmethod void myTestmethod(){
//this is optional
variableofClasstype=new yourClass();
//this is mandatory