You are getting that issue, because when you get("http://gmail.com/")
the id's ("f_id"
and "f_pwd"
are not there.
If your intention is to log in, then you should probably be more specific with your URL, and you should use the following code:
@Test
public void f()throws Exception {
FileInputStream fi=new FileInputStream("E:\\workspace1\\SeleniumAutomation\\test data\\login.xls");
Workbook w= Workbook.getWorkbook(fi);
Sheet s=w.getSheet(0);
driver.findElement(By.id("Email")).sendKeys(s.getCell(0,1).getContents());
driver.findElement(By.id("Passwd")).sendKeys(s.getCell(1,0).getContents());
Thread.sleep(5000);
driver.findElement(By.cssSelector("input#signIn")).click();
Thread.sleep(3000);
}
@BeforeTest
public void beforeTest() {
System.setProperty("webdriver.chrome.driver","\\E:\\lib\\chromedriver.exe");
driver=new ChromeDriver();
driver.get("https://accounts.google.com/ServiceLogin?service=mail");
}
Also, you'll note when clicking the login button, you were looking for a link with the TEXT "input.signin"
I think what you meant to do, is a CSS selector input
with a class of signin
but that element doesn't exist either.