I am unable to log in to Gmail using my code. Please help
public class first_test {
WebDriver driver = new ChromeDriver();
@BeforeTest
public void tearup()
{
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.get("https://accounts.google.com");
}
@Test
public void mail() throws InterruptedException {
WebElement email=driver.findElement(By.id("identifierId"));
email.click();
email.sendKeys("sharfulumair");
WebElement password=driver.findElement(By.id("//*[@name=\"password\"]"));
password.click();
password.sendKeys("abcd");
}
@AfterTest
public void teardown()
{
driver.close();
}
}
The error message I got is:
Unable to locate element: {"method":"id","selector":"identifierId"}