RE: How to automate Image Captcha
Question asked in Sapient:
I am working Automation in Selenium, I have to automate on registration Page and this Page contains a Google Image captcha which is a mandatory field , Can you please let me know how to skip the field to complete my script to automate or any other possible way to achieve it.
The purpose of captcha is to prevent automated attacks.
1. The best way to deal with captcha is to disable captcha in test environment. Run your automated test and enable again. If this is not feasible, read further.
2. However, Captchas can be automated if we are able to decode the image using OCR(Optical character recognition tools). This would still require expert level image pattern mapping and writing a complex algorithm to sort out the image pattern.
3. Another solution for automated testing of captcha is to make a back door entry. This would need an application code change (however, only dev team can tell if it is at all feasible for Google CAPTCHA).
Make the captcha so it will always accept two inputs. The first is the randomly generated string we present to the user and the other is a secret back door value. So if you input the secret backdoor key it is always accepted. If you hard code the key there is a the danger it will get out to the public. If the developers can make the secret key a configurable value, one just needs to edit the configuration file to change the key.
Also note that ideally any captcha back door is only enabled in a test environment, and there should be a test that is run in production after each install to verify that it is disabled there.