@Test(priority = 0)
public void test() throws Exception {
driver.get(baseUrl + "/");
driver.findElement(By.name("email")).clear();
driver.findElement(By.name("email")).sendKeys("lanka@ensiz.com");
driver.findElement(By.name("password")).clear();
driver.findElement(By.name("password")).sendKeys("123456");
driver.findElement(By.xpath("//button[contains(text(),'Sign In')]")).click();
}
@Test(priority = 1)
public void verifyHomepageTitle(){
String expectedTitle = "Placer Admin - Home";
String actualTitle = driver.getTitle();
Assert.assertEquals(actualTitle, expectedTitle);
}
@AfterClass(alwaysRun = true)
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
}
I'm new to automation testing.I want to make sure the valid user logins.For that i'm trying to verify the title of the page.But my test fail all the time,because it is execute before valid user going to the dashboard.how can I test this?Can i know the proper modifications for this code?
Please help..thanks