Exemple #1
0
 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));
 }
Exemple #2
0
 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);
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        // 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);
        }
Exemple #5
0
 internal static IEnumerable <WatiN.Core.Element> WithinScope(this IEnumerable <WatiN.Core.Element> elements, WatiN.Core.Element scope)
 {
     return(elements.Where(e => IsWithinScope(e, scope)));
 }
Exemple #6
0
 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)));
 }
Exemple #7
0
 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)));
 }
Exemple #8
0
 public LambdAssert GetFrom(WatiN.Core.Element ele)
 {
     return(GetFrom(new WatinElement(ele, ParentLAWW)));
 }