Closed Gyaani closed 9 years ago
To prove that its automatable I have also automated the Visual Captcha recognition in http://demo.visualcaptcha.net/?status=validImage Script achieves 100% recognition. Can show demo of script execution if needed or share a video. Please let me know
I believe this can be beaten by https://github.com/emotionLoop/visualCaptcha/issues/2
Also, the message of validation in the demo doesn't mean the image was valid. Showing the success message is something handled by the front-end, as that is just a demo.
Closed by what closed #2
My development team recently implemented Visual Captcha solution. I am a tester in the team and I was able to automate Visual Captcha recognition. My development team is therefore currently working on an alternate solution to enhance the Visual Captcha so it can't be automated. Here is how I automated it.
What development team implemented:
Pre-requisites for test automation:
How I automated Visual Captcha recognition:
Here is the C# code that I used to do this automation.
Code to read text from image: public void ThenIGetTheIconInformationThatWebsiteWantsMeToClick() { string RepositoryPath = @"\mir\ECommDev\CAPTCHARepository\"; string FileToDecipher = "Question1.png"; Process pProcess = new Process(); pProcess.StartInfo.FileName = @"C:\Windows\System32\cmd.exe"; string ProcessArgs = @"/c tesseract " + RepositoryPath + FileToDecipher + @" " + RepositoryPath + @"Utils\CAPTCHAQuestion"; pProcess.StartInfo.Arguments = ProcessArgs; pProcess.StartInfo.UseShellExecute = false; pProcess.StartInfo.CreateNoWindow = true; pProcess.StartInfo.RedirectStandardOutput = true; pProcess.Start(); string[] lines = File.ReadAllLines(RepositoryPath + @"Utils\CAPTCHAQuestion.txt"); string CAPTCHAQuestion = lines[0].ToUpper().Trim(); Console.WriteLine("CAPTCHA Question is: " + CAPTCHAQuestion); }
Code to compare answer image with repository image: