开发者

Watin : Validate link of child browser and closing it

I'm trying to find a way to close a child browser, the idea is when the browser pops up(currently using IE & tab for mozilla)it will load and then closes.

The only thing i can think of is inserting this after the browser opened

 IE newIE = new IE();
 newIE.Close();

Sadly it doesn't worked.I know watin can open two or three browsers but can it open and shift to another browser and then go back to the main browser

Main browser => child browser(close this) => Main browser

What am i missing 开发者_如何学Chere?

I tried something like this but it doesn't work

IE ie = IE.AttachToIE(Find.ByUrl("google.com"));
ie.Close();


I was trying to do something similar in some of my tests and I was having some problems too. You may find that adding a thread sleep will help. This is what I had:

System.Threading.Thread.Sleep(5000);
IE popUpWindow = IE.AttachTo<IE>(Find.ByUrl(s =>s.StartsWith("http://www.google.com")));
Assert.IsTrue(popUpWindow.Title.Contains("google - Google Search"));
popUpWindow.Close();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜