tags:

views:

238

answers:

2
+1  A: 

The test framework you use will make no difference, I'm afraid -- this is one of the "gotchas" of any screen-scraping test framework, and WaTin is no different.

The WaitForComplete() call is definitely necessary, I'm afraid.

Some of my colleagues have reported that the version of IE can make a difference; IE6 in particular has some internal timing issues that can cause problems. IE8 appears to be quite a bit better.

Jeremy McGee
A: 

Try using

[Test] public void WebPageTest() { string url = "www.google.com"; IE ie = new IE(url); ie.TextField(Find.ByTitle("Google Search")).TypeText("Watin"); var btnG = ie.Button(Find.ByName("btnG")); btnG.ClickNoWait(); ie.WaitForComplete(400); var elementWatin = ie.Element(Find.ByText("WatiN")); elementWatin.ClickNoWait(); ie.WaitForComplete(400); Assert.IsTrue(ie.Text.Contains("Welcome at the WatiN"));
ie.Close(); }

Thanks Gandhi Rajan

Gandhi Rajan