Dealing with Captcha within your automated tests
CAPTCHA as an acronym for "Completely Automated Public Turing test to tell Computers and Humans Apart".
We cannot automate CAPTCHA within automated tests, as it is not meant to be automated. If a "machine" can crack it or solve the CAPTCHA, then the CAPTCHA is not really working within your applications. Having said that, there are some options available for you to deal with CAPTCHA within your automated tests.
Options:
Request your application development team for a workaround, like configuring CAPTCHA in test environment in such a way it will always accept 1 specific value, and feed that specific value within your automated tests.
Request your application development team to disable the CAPTCHA module in the testing environment where you are running your automated tests.
If your are using custom CAPTCHA module, you can request your application development team to generate an API of CAPTCHA generation for the testing environment.
You can request your application development team to add CAPTCHA code as
title
in the application page's html markup and then you can have your automated test access that title and bypass the CAPTCHA, but only in the testing environment.
Most of the people use the options 1 or 2 listed above.