I have a WATIN test like the following:
[Test]
public void IE_should_launch_on_correct_url()
{
// do something here that should launch IE
...
_ie = IE.AttachToIE(Find.ByUrl(someUrl));
...
Assert.IsNotNull(_ie);
}
[TearDown]
public void Tidy()
{
_ie.Close();
}
If there's another IE (7) opened, the first line of the test opens a new tab on that IE and then the last one asserts there's an IE with that url opened. Now, when the Tidy
method executes, it closes the first tab opened in IE, not the one the test opened.
How can I avoid that? Is there any way I can close an arbitrary tab with WATIN?
Thanks in advance