Http://seleniumworks.blogspot.kr/2013/09/handling-captcha-webdriver.html
Make use of the ' input ' tag with type ' hidden ' in-order to handle Captcha.
Example for reference.
Driver.get ("Http://www.google.com/recaptcha/learnmore");
Driver.switchto (). frame (0); Calling IFRAME with no ID
Javascriptexecutor js = (javascriptexecutor) driver;
Setting the CAPTCHA values
Js.executescript ("Document.getelementsbyname" (' Recaptcha_challenge_field ') [0].setattribute (' Value ', ' 03AHJ_ Vuv4tv3frmuhbiml9jpkwjnqs1kdbfdkfg1jhqa2uhl4u1vzlxxtzmmkzoahuvcxa1js3giaaqj-zqyuledzzp-peov-y_ fx87-u6hvu4nh8kfwpzfpu50yev5oscb20ptwmgr5eeoate8dfalwcvejjtp779upzfaqn_id5iqj2f9nw218 ') ");
Driver.findelement (By.name ("Recaptcha_response_field")). SendKeys ("23129555894");
Driver.findelement (By.name ("Button1")). Click ();
Note:setattribute plays a major role here.Posted by prashanth Sams at 03:25 Email Thisblogthis!Share to TwitterShare to FacebookShare to PinterestLabels:captcha, selenium, Webdriver3 Comments:
- Suriya Guru 1 October at 06:14
Hi Prasanth,
Is there anyway to type captcha text without typing 23129555894 other than OCR.
Reply
- Anonymous January at 02:43
Hi
I do the same, but it shows incorrect Captcha.
Reply
- MOhan S April at 03:34
From where do got this value or what we are entering this 23129555894?
Reply
Handling Captcha | Webdriver