Пример #1
0
        private ElemsType FindElements(SelBy seleniumBy)
        {
            ElemsType elements = new ElemsType(this);

            try
            {
                var tmp = Instance.FindElements(seleniumBy).ToList();

                elements.SetElements(tmp);

                return(elements);
            }
            catch (Exception)
            {
                //// No errors -- as designed
            }

            return(elements);
        }
Пример #2
0
        private ElemType FindElement(SelBy seleniumBy)
        {
            ElemType element = new ElemType(this);

            try
            {
                var tmp = Instance.FindElement(seleniumBy);

                element.SetElement(tmp);

                return(element);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
                //// No errors -- as designed
            }

            return(element);
        }
Пример #3
0
        private ElemsType FindIfrElements(BaseClasses.By by)
        {
            switch (by.CurrType)
            {
            case (int)BaseClasses.By.PossibleTypes.Class:
                return(FindElements(SelBy.ClassName(by.CurrValue)));

            case (int)BaseClasses.By.PossibleTypes.CssSelector:
                return(FindElements(SelBy.CssSelector(by.CurrValue)));

            case (int)BaseClasses.By.PossibleTypes.Id:
                return(FindElements(SelBy.Id(by.CurrValue)));

            case (int)BaseClasses.By.PossibleTypes.Name:
                return(FindElements(SelBy.Name(by.CurrValue)));

            case (int)BaseClasses.By.PossibleTypes.Xpath:
                return(FindElements(SelBy.XPath(by.CurrValue)));
            }

            throw new Exception("Something going wrong, dude!");
        }