My WatiN tests have suddenly gotten REALLY slow when I dispose the Internet Explorer object.
Here's my setup...
* Windows 7 (Evaluation Build 7100)
* Internet Explorer 8 (Version 8.0.7100.0)
* WatiN (Version 2.0.10.928)
This is strange because the tests were working fine a week or so ago. I think it's the latest MS Updates or something.
Any ideas?
My setup:
*IE 9
*Windows 7
*Watin 2.1
*Visual Studio 10 SP1, using Microsoft.VisualStudio.TestTools.UnitTesting
Since I have multiple TestMethods and TestClasses, I wanted to put IE.Close() in an AssemblyCleanup() method. Due to MSTest threading issues, I then had to call close() like this:
[AssemblyCleanup()]
public static void CleanupAllTests()
{
var thread = new Thread(() =>
{
IE.Close();
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
}
*Again, IE in this snippet refers to a property that will check for and attach to my IE instance using the strategy from the link above. This snippet probably won't solve your problems without the rest of the pattern that I linked to.
Before this setup IE would sometimes take 30+ seconds to close, now I can open and close other IE windows all I want while the tests are running, and the browser always closes reliably.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With