title: Selenium Gmail login password field
body: <p>I am trying to login Gmail using selenium web driver. The problem I am facing is that I am not able to set the password in the input box.</p>
  
  <p>Here is the generated error message:</p>
  
  <blockquote>
    <p>Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot focus element.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>    public static void main(String[] args) {
      System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");
      WebDriver driver=new ChromeDriver();
      driver.navigate().to("http://www.gmail.com");
      driver.findElement(By.cssSelector("#identifierId")).sendKeys("********@gmail.com"); 
      driver.findElement(By.cssSelector("#identifierNext")).click();
      WebDriverWait wait = new WebDriverWait(driver, 10);
      wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("#password")));
  
      driver.findElement(By.cssSelector("#password")).sendKeys("********"); 
      driver.findElement(By.cssSelector("#passwordNext")).click();
      driver.close();
      driver.quit();
  }
  </code></pre>