开发者

Captcha with WatiN Library

开发者 https://www.devze.com 2023-01-30 11:53 出处:网络
Does anyone开发者_JAVA百科 have experiance with Captcha on \"WatiN\" library ? The site I want to get data is having a \"captcha\" on the login page. I can enter that value if app can show captcha im

Does anyone开发者_JAVA百科 have experiance with Captcha on "WatiN" library ?

The site I want to get data is having a "captcha" on the login page. I can enter that value if app can show captcha image and wait for my input in a given text box on app.

Can we achive that from this library, if you can like to have a sample.


ok...It seems you want to enter only captcha value manually..!!!other fields you want to automate.Ok the below solution may not be perfect but it works and its just an idea...or you can ask user to input the captcha value in an input box(use in place of msgbox),then take the value and put it in the captcha field.

        IE ie=new IE();

        ie.GoTo("http://captchas.net/registration/");
        ie.TextField(Find.ByName("user")).Value="username";
        ie.TextField(Find.ByName("mail")).Value="abcd@xyz.com";
        //string captch_value="";

        do
        {
            MessageBox.Show("Enter Captcha value...after entering correct captcha press Ok");

           //captch_value=ie.Eval("window.prompt('enter captcha')");
        }while(ie.ContainsText("Wrong Password entered. Try again"));

        //ie.TextField(Find.ByName("password")).Value=captch_value;

        ie.Button(Find.ByValue("Submit")).Click();


You can integrate Watin with a captcha solving service that has an API such as http://www.deathbycaptcha.com or similar site. So you would do the following.

  1. Load the Page in Watin
  2. Get the Captcha image
  3. Submit it to the Captcha Solver API they will provide you with the results
  4. Take that result and put it in the Captcha textbox.


As far as I know we can't automate all CAPTCHA's."Completely Automated Public Turing test to tell Computers and Humans Apart",As the name implies it is used to prevent automation.If we can automate whats the use of CAPTCHA?Only Poorly designed CAPTCHA's can be captured using complex matching algorithms.

0

精彩评论

暂无评论...
验证码 换一张
取 消