public class EditProfile {
// public static WebDriver driver;
//public TestLogin login;
// public static String baseURL = Configuration.testsite;
TestLogin login = new TestLogin();
public static WebDriver driver;
@BeforeClass
@Parameters("browser")
public void LoginToAnalytics() throws Exception{
//WebDriver driver = new FirefoxDriver();
login.setup("Firefox");
login.testLogin();
}
analyticsLoginPage mylogin = PageFactory.initElements(driver, analyticsLoginPage.class);
********//Edit Progile test that fails******
@Test//(dependsOnMethods = { "testLogin" })
///******** Edit profile code
public void verifyEditProfile() throws InterruptedException {
*******//Getting null pointer here. Please help me understand why.///////
analyticsLandingPage landingpage = PageFactory.initElements(driver, analyticsLandingPage.class);
*******///This will work fine once it gets to this part
analyticsEditProfilePage editprofile = PageFactory.initElements(driver, analyticsEditProfilePage.class);
*******waiting for page to load ///////////
Thread.sleep(3000L);
landingpage.gotoProfile();
/////This part is not running because of the error***////
editprofile.verifyEditFirstName();
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…