tags:

views:

222

answers:

1

I want to check if an IE is already opened or not

If IE is opened so i.e. Goto("WWW.GOOGLE.COM");
else open new IE and goto Yahoo.com

for example:

 br = new WatiN.Core.IE(@textBox1.Text);

then when I press a button I want to check if IE is opened or not and perform the previous scenario.

A: 

Use:

IE.Exists(Find.ByUrl("Yahoo.com"));

In WatiN 2.0 RC1 this will be:

Browser.Exists(Find.ByUrl("Yahoo.com"));

HTH, Jeroen

Jeroen van Menen
Thank you for your reply,but I want to check for the opened IE instances by (br) but IE.Exists(Find.ByUrl("Yahoo.com"));will return true also if there is an IE instance opened manually and has the same URL.
SD
In that case, maybe this code/idea might help http://watinandmore.blogspot.com/2009/03/reusing-ie-instance-in-vs-test.html
Jeroen van Menen