public override UIControlBase[] GetChildren() { List <UIControlBase> children = new List <UIControlBase>(); foreach (IE browser in WatiN.Core.IE.InternetExplorers()) { if (browser.NativeDocument != null) { children.Add(new WatBrowser(browser)); } } FireFox ffBrowser = null; try { ffBrowser = FireFox.AttachTo <FireFox>(WatiN.Core.Constraints.AnyConstraint.Instance, 2); } catch { } if (ffBrowser != null) { children.Add(new WatBrowser(ffBrowser)); } return(children.ToArray()); }
public void FireFoxCanAttachByUri() { using (var fireFox = new FireFox(NewWindowUri)) { fireFox.Links[0].Click(); var newWindow = FireFox.AttachTo <FireFox>(Find.ByUrl(NewWindowTargetUri)); Assert.That(newWindow.Text.Trim() == "Welcome to the new window."); newWindow.Close(); } }
public void FireFoxCanAttachByTitle() { Settings.AttachToBrowserTimeOut = 3; using (var fireFox = new FireFox(NewWindowUri)) { fireFox.Links[0].Click(); var newWindow = FireFox.AttachTo <FireFox>(Find.ByTitle("New Window Target Page")); Assert.That(newWindow.Text.Trim() == "Welcome to the new window."); newWindow.Close(); } }
public void FireFoxCanDisposeAttachedBrowser() { using (var fireFox = new FireFox(NewWindowUri)) { fireFox.Buttons[0].Click(); using (var newWindow = FireFox.AttachTo <FireFox>(Find.ByUrl(NewWindowTargetUri))) { Assert.That(newWindow.ContainsText("Welcome"), Is.True, "Expected 'Welcome'"); } Assert.That(fireFox.Buttons[0].Exists); } }