0

I'm automation on site which has Gmail/google login, previously it was just asking for login and password credentials but after some days site now asks for captcha after entering the login id of the user and I'm not able to disable or automate it. I haven't changed my code, for same code captcha was not coming previously but now it's asking to enter the captcha. please help.

Eclipse IDE for Java Developers

Version: 2018-12 (4.10.0) Build id: 20181214-0600

package rd_Site;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class Whats_Happening_LikeComment {

    public static void main(String[] args) throws InterruptedException {

        System.setProperty("webdriver.chrome.driver", "C:\\Users\\sonal.kudale\\Downloads\\chromedriver_win32\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();

        driver.get("http://test.rd.com/");
        WebElement email = driver.findElement(By.xpath("//*[@id=\"identifierId\"]"));
        email.sendKeys("sonal.k"); 

        WebElement login = driver.findElement(By.xpath("//*[@id=\"identifierNext\"]/content/span"));
        login.click();

        Thread.sleep(8000);
        driver.findElement(By.name("password")).sendKeys("Sonal@",Keys.ENTER);
        Thread.sleep(4000); 

        System.out.println("User logged in");
    }    
}

the expected result should be entered id- click next- enter a password- click log in and user logged in. The actual result is entered id - and asking for captcha. Also, the site won't ask for captcha if I enter credentials manually. (without running automated code)

sh.seo
  • 1,482
  • 13
  • 20

1 Answers1

0

Yep,

Thats what captcha is used for, to prevent you from automating login attempts. Im afraid there is no way to disable this.

If google didnt force captcha on you, you (or anyone) could just run powerfull service trying to guess users ID and pass combinations.

Clomez
  • 1,410
  • 3
  • 21
  • 41