How do we test the ReCAPTCHA field in a web page?
In Selenium, during the registration in any common web pages, How do we capture the words in the image in the Anit-Span verification(to ensure its human made entry) section and ensure these words are entered in the field correctly while playback? Firstly, is it possible during automation as this is dynamic image and does this need manual intervention?
Well , captcha are just meant to prevent what you exactly described .
So you may not automate it.
But you can have alternate
1. Development team need to disable it
2. You can pick its value from origin if it is coming from db or file.
If it's a 3rd party service. Check if there is a developer or sand box mode that can be enabled for your test systems.
Captcha can't automate its change dynamically. Better you go with yogi alternative idea
Thanks everyone for the reply. So, if we go with the disable of this field, then this particular field needs manual testing for every registration right? I was wondering if we were going to pick up say even 100 records from a data table and register them, how do we handle this scenario? I reckon the method of extracting the value from DB or File or a Variable may be more apt.
The best approach is have a serverside debug/test flag that injects the answer. This will still allow testing of the CAPTCHA hookup is working correctly.
Here's the downside of the database approach. You create an unnecessary dependency on the backend. Say a dev refactors the database, or the database can be replaced from a SQL to a NoSQL, or from a single to a distributed DB. Plus most likely a capcha answer is not stored in a DB. Since it's a temporary value that's thrown away with short life, it's more likely it's done in a high speed temporary keystore. Do you put your test dependency on the backend and system level? or do you shift it closer to the front end where your devs have better control?
You shouldn't have to need to manual test every build. In theory you'll only need to retest in architecture changes or changes to the CAPTCHA itself.
Thank you David for the clarification.