title: Sign in to gmail account fails (selenium automation)
body: <p>I have a Selenium service that has to login to my gmail account as the first step. This functionality was working couple of weeks ago, but suddenly the login starts to fails and i am seeing this Error in browser, tried both in Chrome and Firefox drivers in selenium - </p>
  
  <p><a href="https://i.stack.imgur.com/9I7oU.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9I7oU.png" alt="enter image description here"></a></p>
  
  <p>This Error comes after the selenium service inserts the email,password and clicks on the sign in button. A similar error was also reported in Google support Forum here- <a href="https://support.google.com/accounts/thread/10916318?hl=en" rel="noreferrer">https://support.google.com/accounts/thread/10916318?hl=en</a>, They said that "Google seems to have introduced automation tools detection on their login flow!" but there is no solution in this thread. </p>
  
  <p>Some Other Details which might be useful-</p>
  
  <ul>
  <li>I am not able to login manually to Google accounts in the browsers<br>
  opened by Selenium.</li>
  <li>But I am able to login manually to these accounts in the Google
  Chrome application.</li>
  </ul>
  
  <p>Let me know if you need to take a look at the code, i will post it here.
  Thanks in Advance!</p>
  
  <p><strong>Edit</strong>
  Adding Sample code to refer.</p>
  
  <pre><code>public void loginGoogleAccount(String emailId, String password) throws Exception {
      ChromeOptions options = new ChromeOptions();
      options.addArguments("--profile-directory=Default");
      options.addArguments("--whitelisted-ips");
      options.addArguments("--start-maximized");
      options.addArguments("--disable-extensions");
      options.addArguments("--disable-plugins-discovery");
      WebDriver webDriver = new ChromeDriver(options);
      webDriver.navigate().to("https://accounts.google.com");
      Thread.sleep(3000);
      try {
          WebElement email = webDriver.findElement(By.xpath("//input[@type='email']"));
          email.sendKeys(emailId);
          Thread.sleep(1000);
  
          WebElement emailNext = webDriver.findElement(By.id("identifierNext"));
          emailNext.click();
          Thread.sleep(1000);
  
          WebDriverWait wait = new WebDriverWait(webDriver, 60);
          wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("identifierNext")));
  
          Thread.sleep(3000);
          WebElement passwordElement = webDriver.findElement(By.xpath("//input[@type='password']"));
          passwordElement.sendKeys(password);
  
          Thread.sleep(1000);
          WebElement passwordNext = webDriver.findElement(By.id("passwordNext"));
          passwordNext.click();
  
      } catch (Exception e) {
          LOGGER.info(String.format("No email/password field available or it is already logged in: [%s]: ",
                  e.getMessage()));
      }
  }
  </code></pre>