How can we automate randomly generated fields?


Hii all,
I would like to automate a registration screen which has one field that randomly changing values. If you check “Please enter an answer in digits:” field in registration screen. Please go through below link

I don’t know whether it is possible or not. If you found any solution please provide.

Default Asked on October 27, 2014 in Selenium WebDriver.
  • 6 Answer(s)
    Best answer


    There are different types of capcha available now days. Automating a strong capcha is almost impossible and that’s why they have put capcha in place to avoid robots. Most of the strong capcha involves the use of images & distorted text.

    Bheem is right that some capchas are able to automate, as there are simple capcha also available like the one we have on It is possible to automate that but it will require a good amount of code to handle each and every possible combination like 2 * 2 or 11 + twenty.  

    Ankit is also right that it is not advisable to automate capcha and if you have any application to test with capcha, then it is advisable to instruct the developers to bypass the capcha integration on test environment.

    Lakshay Sharma

    Professor Answered on October 27, 2014.
    Add Comment

    Hi Sandhya

    That is Capcha and You Cant Automate Capcha , What you can do is Simply Put Some Thread.sleep(); and Enter Those Values Manually


    Vice Professor Answered on October 27, 2014.
    Add Comment

    Ankit ,

    What all values are expected, If they are always the conditions like the Ar-thematic functions. Can’t we track the text and do a Java validation for entering the capcha  in the text box.

    Correct me if i am wrong.

    Only Pre-Condition is the range of values expected.

    Supporter Answered on October 27, 2014.

    Hi Bheem
    You can Track if Values are Expected But Capturing Capcha is Not Suggested

    on October 27, 2014.
    Add Comment

    Thanks Lakshay.

    I think  we can use some User agents to skip this functionality for a particular environment.
    I have done the same for skipping a POPUP in my project.

    Lakshay : Can you post a topic working of an User agent , how does it effects a browser so on.

    Supporter Answered on October 27, 2014.
    Add Comment

    Hi Sandhya,
    Please refer this link. Let me know if you want to know more on that.

    Train Answered on October 28, 2014.
    Add Comment

    Thank you all for your valuable suggestions, I already used thread.sleep() to skip capcha (Which is a google authenticator generated values) in our project  but i had doubt that we may handle these type of scenarios also,  but yes am clear with your answers now.


    Default Answered on October 30, 2014.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.