How to automate Recaptcha in robot framwork

Hello ,
I’m trying to automate recaptca using robotframework. I have write code for same
Open Browser ${url} ${browser}
Maximize Browser Window
Sleep 5s
Input Text ${sign_in_email_xpath} ${email_id}
Input Password ${sign_in_password_xpath} ${password}
Wait Until Page Contains Element id=“rc-anchor-container” 30s
Wait Until Page Contains Element //span[@id=‘recaptcha-anchor’] 30s
Click Element //span[@id=‘recaptcha-anchor’]
Sleep 5s
Click Button ${log_in_button_xpath}
recaptcha

above code is not working for me , script get fails anyone please let me know?

That is the paradigm:

How can Robot Framework, prove it is not a Robot?

In other words:
Why would you automate something who’s goal is to impede automation?

These are my “alternatives”:

  • Don’t test those systems :wink:
  • Ask developers if they can add some attribute or alternate page to avoid CAPTCHAs (test env pages could not have them)
  • Have a manual step to wait for Human to do the Login procedure
2 Likes

Hi Vishwa,

Even if you managed to automate the recaptca, the company behind it spends a lot of resources on ensuring that it can’t automated, so expect it to change again so that your working automation will start failing.

My alternatives list is the same as Helio’s above, I’ll just add that DialogsLibrary is handy if you choose the 3rd alternative.

Dave.

1 Like

It is working our local system but how can I run Jenkins ?

Hi @harishpremkumar,

I’m guessing from your question you choose the 3rd alternative? If so this option is not compatible with Jenkins or any CI/CD system.

Refer back to the other alternatives, if the 2nd is not possible then you’re left with the 1st.

Or there is a 4th, Have the test Fail with an error like “CAPTCHA blocks test automation”, then raise a defect on the failing test cases, with several defects you can then raise a risk on the project and risk mitigation becomes the Project Manager’s problem.

Fail		CAPTCHA blocks test automation

But I’m not telling anything new here, the question was already answered.

Dave.

1 Like