Cannot login with WatiN

75 Views Asked by At

I'm trying to log in a website that use a ".cgi" instead of a ".html". The input field have this HTML code:

<input name="username" class="input" type="text" size="20"></input>

As you can see there is nothing special. I got to the website but it doesn't write anything. I did it with a simple case (Google) and it did work.

using ( var Browser = new IE())
{
    Browser.GoTo("http://testweb.com"); 
    Browser.TextField(Find.ByName("username")).TypeText("User");
    Browser.TextField(Find.ByName("password")).TypeText("Pass");
}

Does anyone knows what's not working ?

UPDATE:

-----------------------

I've tried this code:

using (var Browser = new IE())
{
    Browser.GoTo("testweb.com");

    TextFieldCollection textFields = Browser.TextFields;

    foreach (var field in textFields)
    {
        if (field.Name == "username")
        {
            System.Windows.Forms.MessageBox.Show("FOUND");
        }
    }
}

and I obtain this:

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

0

There are 0 best solutions below