How to By Pass Google reCapctha using Automation

Captcha means : Completely Automated Public Turing test to tell Computers and Humans Apart

Please find below the various Scenario how can we handle Google Captcha:


  1. Either ask dev team for a workaround, like configure CAPTCHA in test environment in such a way it will always accept 1 specific value.
  2. Ask developer to disable the CAPTCHA module in testing environment.
  3. You can ask dev team to add CAPTCHA code as title in markup, then you can access this title and bypass the CAPTCHA by adding the key in your automation code, but only in the testing environment.
For this point we can add following line of code in Automation code and it will by pass captcha:

WebDriver driver = new WebDriver();
Cookie captcha = new Cookie("automation_recaptcha_key","6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI");
driver.manage().addCookie(captcha);

The Key mentioned above is provided by google itself to by pass the captcha.


Comments