I would like to add a captcha, such as reCaptcha, to a certain functionality on my site. How could I adapt my acceptance tests?
Is the only solution to disable the captcha's on the staging site?
Clarification:
Of course I am not speaking of brute-force cracking my own captcha, but e.g. some option to inject a state into the captcha from the server side that my test knows about.
PS My server side code uses the Pyramid framework, and my tests are written using Selenium
A CAPTCHA test is made up of two simple parts: a randomly generated sequence of letters and/or numbers that appear as a distorted image, and a text box. To pass a the test and prove your human identity, simply type the characters you see in the image into the text box.
reCAPTCHA is a free service from Google that helps protect websites from spam and abuse. A “CAPTCHA” is a turing test to tell human and bots apart.
Acceptance Testing is the last phase of software testing performed after System Testing and before making the system available for actual use. Types of Acceptance Testing: User Acceptance Testing (UAT): User acceptance testing is used to determine whether the product is working for the user correctly.
Yes, the only option is disabling Captcha - for a very good reason. If it's easy enough to bypass it with Selenium, why would you have a Captcha in the first place?
The point isn't to test Captcha with your Selenium tests -- Why spend the significant effort to test a third party tool?
Instead, I'd have a Selenium test that verifies your Captcha is showing up. This validates your Captcha is present and active. After that test I'd turn Captcha off and proceed with your other validation tests. I'd also have a final step of turning Captcha back on and repeating the test detecting Captcha is active. That way you're ensuring you didn't miss something when reactivating Captcha.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With