Inheritance: OpenQA.Selenium.By
Exemplo n.º 1
0
 public static new SelectBy TagName(string tagNameToFind)
 {
     if (tagNameToFind == null)
     {
         throw new ArgumentNullException("tagNameToFind", "Cannot find elements when name tag name is null.");
     }
     SelectBy by = new SelectBy("SelectBy.TagName");
     by.FindElementMethod = (ISearchContext context) => ((IFindsByTagName)context).FindElementByTagName(tagNameToFind);
     by.FindElementsMethod = (ISearchContext context) => ((IFindsByTagName)context).FindElementsByTagName(tagNameToFind);
     by.Value = tagNameToFind;
     return by;
 }
Exemplo n.º 2
0
        public new static SelectBy TagName(string tagNameToFind)
        {
            if (tagNameToFind == null)
            {
                throw new ArgumentNullException("tagNameToFind", "Cannot find elements when name tag name is null.");
            }
            SelectBy by = new SelectBy("SelectBy.TagName");

            by.FindElementMethod  = (ISearchContext context) => ((IFindsByTagName)context).FindElementByTagName(tagNameToFind);
            by.FindElementsMethod = (ISearchContext context) => ((IFindsByTagName)context).FindElementsByTagName(tagNameToFind);
            by.Value = tagNameToFind;
            return(by);
        }
Exemplo n.º 3
0
 public static SelectBy CssSelector(string cssSelectorToFind, string formatString)
 {
     if (cssSelectorToFind == null)
     {
         throw new ArgumentNullException("cssSelectorToFind", "Cannot find elements when name CSS selector is null.");
     }
     var fullSelector = string.IsNullOrWhiteSpace(formatString) ? cssSelectorToFind : string.Format(formatString, cssSelectorToFind);
     SelectBy by = new SelectBy("SelectBy.CssSelector");
     by.FormatString = formatString;
     by.FindElementMethod = (ISearchContext context) => ((IFindsByCssSelector)context).FindElementByCssSelector(fullSelector);
     by.FindElementsMethod = (ISearchContext context) => ((IFindsByCssSelector)context).FindElementsByCssSelector(fullSelector);
     by.Value = fullSelector;
     return by;
 }
Exemplo n.º 4
0
 public static new SelectBy CssSelector(string cssSelectorToFind)
 {
     if (cssSelectorToFind == null)
     {
         throw new ArgumentNullException("cssSelectorToFind", "Cannot find elements when name CSS selector is null.");
     }
     SelectBy by = new SelectBy("SelectBy.CssSelector");
     by.FindElementMethod =
         (ISearchContext context) => ((IFindsByCssSelector)context).FindElementByCssSelector(cssSelectorToFind);
     by.FindElementsMethod =
         (ISearchContext context) => ((IFindsByCssSelector)context).FindElementsByCssSelector(cssSelectorToFind);
     by.Value = cssSelectorToFind;
     return by;
 }
Exemplo n.º 5
0
        public static SelectBy CssSelector(string cssSelectorToFind, string formatString)
        {
            if (cssSelectorToFind == null)
            {
                throw new ArgumentNullException("cssSelectorToFind", "Cannot find elements when name CSS selector is null.");
            }
            var      fullSelector = string.IsNullOrWhiteSpace(formatString) ? cssSelectorToFind : string.Format(formatString, cssSelectorToFind);
            SelectBy by           = new SelectBy("SelectBy.CssSelector");

            by.FormatString       = formatString;
            by.FindElementMethod  = (ISearchContext context) => ((IFindsByCssSelector)context).FindElementByCssSelector(fullSelector);
            by.FindElementsMethod = (ISearchContext context) => ((IFindsByCssSelector)context).FindElementsByCssSelector(fullSelector);
            by.Value = fullSelector;
            return(by);
        }
Exemplo n.º 6
0
        public new static SelectBy CssSelector(string cssSelectorToFind)
        {
            if (cssSelectorToFind == null)
            {
                throw new ArgumentNullException("cssSelectorToFind", "Cannot find elements when name CSS selector is null.");
            }
            SelectBy by = new SelectBy("SelectBy.CssSelector");

            by.FindElementMethod =
                (ISearchContext context) => ((IFindsByCssSelector)context).FindElementByCssSelector(cssSelectorToFind);
            by.FindElementsMethod =
                (ISearchContext context) => ((IFindsByCssSelector)context).FindElementsByCssSelector(cssSelectorToFind);
            by.Value = cssSelectorToFind;
            return(by);
        }