internal static bool IsDisplayed(this WatiN.Core.Element element) { if (string.Equals(element.Style.Display, "none")) { return(false); } return(element.Parent == null || IsDisplayed(element.Parent)); }
protected override bool OnPerform(WatiN.Core.Element element) { if (autoSubmit) { element.Click(); } else { var nativeElement = element.NativeElement as IEElement; mshtml.IHTMLElement el = nativeElement.AsHtmlElement; el.setAttribute("__recordmark", RecordMark ? "1" : "0"); } return(true); }
private static bool IsWithinScope(WatiN.Core.Element element, WatiN.Core.Element scope) { if (scope == null) { return(true); } var parent = element.Parent; while (parent != null) { if (parent.Equals(scope)) { return(true); } parent = parent.Parent; } return(false); }
// Finds the dialog box by title. public static string Execute(WatiN.Core.Element button, string dialogBoxTitle) { button.ClickNoWait(); IList <Window> windows; WatiN.Core.Native.InternetExplorer.WindowsEnumerator wE = new WatiN.Core.Native.InternetExplorer.WindowsEnumerator(); windows = wE.GetWindows(null); string result = ""; foreach (Window w in windows) { if (w.Title == dialogBoxTitle) { result = w.Message; w.ForceClose(); break; } } return(result); }
internal static IEnumerable <WatiN.Core.Element> WithinScope(this IEnumerable <WatiN.Core.Element> elements, WatiN.Core.Element scope) { return(elements.Where(e => IsWithinScope(e, scope))); }
internal static WatiN.Core.Element FirstWithinScopeOrDefault(this IEnumerable <WatiN.Core.Element> elements, WatiN.Core.Element scope, Func <WatiN.Core.Element, bool> predicate) { return(elements.FirstOrDefault(e => predicate(e) && IsWithinScope(e, scope))); }
internal static WatiN.Core.Element FirstDisplayedOrDefault(this IEnumerable <WatiN.Core.Element> elements, WatiN.Core.Element scope) { return(elements.FirstOrDefault(e => IsDisplayed(e) && IsWithinScope(e, scope))); }
public LambdAssert GetFrom(WatiN.Core.Element ele) { return(GetFrom(new WatinElement(ele, ParentLAWW))); }