Pregunta

I'm using WatiN 2.1.0 with IE11.

If I use the following code, WatiN sucessfuly navigates to the page, but it doesn't seem to load in the page I'm requesting. Instead, it thinks it's looking at about:blank.

var Browser = new IE();
Browser.GoTo("www.bing.com");
Browser.Url; // = about:blank

I get the same behavior when I attempt to load any page in my intranet.

I originally assumed that IE11 was the problem. But, if I replace bing.com with google.com or yahoo.com or stackoverflow.com, it works like a charm. Any thoughts on why some pages can load but not others?

¿Fue útil?

Solución

Running your process as administrator should allow it to work.

Alternatively, disabling protected mode for your Internet zone should work equally well:

enter image description here

Otros consejos

WatiN 2.1.0.1196 (12 April 2011)

This is WatiN 2.1 final, offering support for both Internet Explorer and FireFox.

This releases fully supports IE9 version only,

I also had ran into several problems when trying to use it with Internet explorer version 10.0

so, for best result while using WatIn with Internet explorer use the Internet explorer version 9.0

Same behavior here, WatiN object seems to loose its attach to IE11, here is my workaround :

Dim IE As New IE()
IE.GoTo("www.bing.com")

Dim _ieHwnd = IE.hWnd.ToString()

//IE.WaitForComplete() not working so I use sleep as a workaround...
System.Threading.Thread.Sleep(1000)
Do
    System.Threading.Thread.Sleep(500)
    IE = Browser.AttachTo(Of IE)(Find.By("hwnd", _ieHwnd), 10)
Loop While Not IE.Text.Contains("Bing")

It's dirty, but it works =)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top