Q:

How to fill CAPTCHA using Test automation?

How can I automate "Enter CAPTCHA" using Selenium WebDriver?

A:

You don't, that is the whole idea behind a good CAPTCHA.
CAPTCHA stands for:

Completely Automated Public Turing test to tell Computers and Humans Apart

So, by definition, resolving a CAPTCHA cannot be automated: Otherwise, it could not tell computers and humans apart and hence fails to be a CAPTCHA.
How to handle a CAPTCHA in a test environment:

If you need to test an application which uses CAPTCHA, then you need to get the development team to build in a workaround/backdoor which is only active in the test environment.
Use a service like http://www.deathbycaptcha.com which has an API to return the text of the CAPTCHA for you. The average response is 15 seconds with a result rate of 90% or so they say. Sounds like something to try.

A:

We cannot automate CAPTCHA, as it is not meant to be automatized.
How to deal with CAPTCHA?

Either ask dev team for a workaround, like configure CAPTCHA in test environment in such a way it will always accept 1 specific value.
Ask developer to disable the CAPTCHA module in testing environment.
If your are using custom CAPTCHA module, you can ask developer to generate an API of CAPTCHA generation for testing environment.
You can ask dev team to add CAPTCHA code as title in markup, then you can access this title and bypass the CAPTCHA, but only in the testing environment.

Most of the time we go with option 1 or 2.
NOTE: When you do work around for CAPTCHA in test environment, You should always have this point in your checklist to make sure workarounds for CAPTCHA testing are removed before it goes on production.

A:

Here's an example of captcha and a robot to cheat it:

