While running the following code:
package prac.sample;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.*;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class SelTestDemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver test1 = new FirefoxDriver();
test1.get("http://www.gmail.com");
test1.manage().window().maximize();
WebElement email = test1.findElement(By.id("Email"));
email.sendKeys("srinivaspavan@gmail.com");
WebElement next = test1.findElement(By.id("next"));
next.click();
WebElement password = test1.findElement(By.ById.id("Passwd"));
password.click();
password.sendKeys("tftctctc141414");
WebElement signin = test1.findElement(By.id("signIn"));
signin.click();
}
}
I see the following error:
Exception in thread "main" org.openqa.selenium.NoSuchElementException:
Unable to locate element: {"method":"id","selector":"Passwd"}
Command duration or timeout: 19 milliseconds
For documentation on this error, please visit:
http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:55:52'
Please help.