Handling Captcha | Webdriver

Source: Internet
Author: User
Tags vcard

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:
  1. Suriya Guru 1 October at 06:14

    Hi Prasanth,

    Is there anyway to type captcha text without typing 23129555894 other than OCR.

    Reply
  2. Anonymous January at 02:43

    Hi
    I do the same, but it shows incorrect Captcha.

    Reply
  3. MOhan S April at 03:34

    From where do got this value or what we are entering this 23129555894?

    Reply

Handling Captcha | Webdriver

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.