views:

68

answers:

3

Hello,

I am using Watin 2.0 to develop some automated UI tests. I cannot get Watin to close the browser after it has opened it. The Watin.Core.Browser object implements IDisposible but Dispose() does not do the trick. I have also tried using the Close() method.

Most recently I have tried wrapping the IE object instantiation in a Using statement but no luck.

I am testing with IE8

 using (IE ie = new IE())
        {
            ie.GoTo(ApplicationContainer.SummaryUriProvider.URI);
            Link furthurReadingLink = ie.Link(Find.ByText("Further Reading"));
            furthurReadingLink.Click();

            string subTitle = ie.Div("frheader").Element(Find.ByClass("panelsubtitle")).Text;

            Assert.AreEqual("Further Reading", subTitle);
        }
A: 

ie.close() worked for me in ie 8

eden
A: 

Also, You might want to check your browser AutoClose property ie.AutoClose

Shady M. Najib
A: 

It seems that if the test throws some exception the dispose is never called.

Nick