/// <summary>
        /// Finds many elements
        /// </summary>
        /// <param name="context">Context used to find the element.</param>
        /// <returns>A readonly collection of elements that match.</returns>
        public override ReadOnlyCollection <IWebElement> FindElements(ISearchContext context)
        {
            Type contextType           = context.GetType();
            Type findByAccessibilityId = contextType.GetInterface(InterfaceNameRegExp, false);

            if (null == findByAccessibilityId)
            {
                throw new InvalidCastException("Unable to cast " + contextType.ToString() + " to IFindByAndroidUIAutomator");
            }
            MethodInfo m = findByAccessibilityId.GetMethod("FindElementsByAndroidUIAutomator", new Type[] { typeof(string) });

            return(CollectionConverterUnility.
                   ConvertToExtendedWebElementCollection <IWebElement>((IList)m.Invoke(context, new object[] { _Selector })));
        }
Beispiel #2
0
 /// <summary>
 /// Finds a list of elements that match the part of the link text supplied
 /// </summary>
 /// <param name="partialLinkText">Part of the link text</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <W> FindElementsByPartialLinkText(string partialLinkText)
 {
     return(CollectionConverterUnility.
            ConvertToExtendedWebElementCollection <W>(base.FindElementsByPartialLinkText(partialLinkText)));
 }
Beispiel #3
0
 /// <summary>
 /// Finds a list of elements that match the CSS selector
 /// </summary>
 /// <param name="cssSelector">The CSS selector to match</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <W> FindElementsByCssSelector(string cssSelector)
 {
     return(CollectionConverterUnility.
            ConvertToExtendedWebElementCollection <W>(base.FindElementsByCssSelector(cssSelector)));
 }
Beispiel #4
0
 /// <summary>
 /// Finds a list of elements that match the ID supplied
 /// </summary>
 /// <param name="id">ID of the element</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <W> FindElementsById(string id)
 {
     return(CollectionConverterUnility.
            ConvertToExtendedWebElementCollection <W>(base.FindElementsById(id)));
 }
Beispiel #5
0
 /// <summary>
 /// Find the elements on the page by using the <see cref="T:OpenQA.Selenium.By"/> object and returns a ReadonlyCollection of the Elements on the page
 /// </summary>
 /// <param name="by">Mechanism to find element</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <W> FindElements(By by)
 {
     return(CollectionConverterUnility.
            ConvertToExtendedWebElementCollection <W>(base.FindElements(by)));
 }
Beispiel #6
0
 /// <summary>
 /// Finds a list of elements that match the class name supplied
 /// </summary>
 /// <param name="className">CSS class name on the element</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection<W> FindElementsByClassName(string className)
 {
     return CollectionConverterUnility.
         ConvertToExtendedWebElementCollection<W>(base.FindElementsByClassName(className));
 }
 /// <summary>
 /// Finds a list of elements that match the CSS selector
 /// </summary>
 /// <param name="cssSelector">The CSS selector to match</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <AppiumWebElement> FindElementsByCssSelector(string cssSelector) =>
 CollectionConverterUnility.
 ConvertToExtendedWebElementCollection <AppiumWebElement>(base.FindElementsByCssSelector(cssSelector));
Beispiel #8
0
 /// <summary>
 /// Finds a list of elements that match the accessibillity id supplied
 /// </summary>
 /// <param name="selector">accessibility id</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public ReadOnlyCollection <W> FindElementsByAccessibilityId(string selector)
 {
     return(CollectionConverterUnility.
            ConvertToExtendedWebElementCollection <W>(base.FindElements("accessibility id", selector)));
 }
Beispiel #9
0
 /// <summary>
 /// Finds a list of elements that match the name supplied
 /// </summary>
 /// <param name="name">Name of the element on the page</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <W> FindElementsByName(string name) =>
 CollectionConverterUnility.
 ConvertToExtendedWebElementCollection <W>(base.FindElementsByName(name));
Beispiel #10
0
 /// <summary>
 /// Finds a list of elements that match the link text supplied
 /// </summary>
 /// <param name="linkText">Link text of element</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <W> FindElementsByLinkText(string linkText) =>
 CollectionConverterUnility.
 ConvertToExtendedWebElementCollection <W>(base.FindElementsByLinkText(linkText));
 /// <summary>
 /// Find the elements on the page by using the <see cref="T:OpenQA.Selenium.By"/> object and returns a ReadonlyCollection of the Elements on the page
 /// </summary>
 /// <param name="by">Mechanism to find element</param>
 /// <returns>ReadOnlyCollection of elements found</returns
 public new ReadOnlyCollection <AppiumWebElement> FindElements(By by) =>
 CollectionConverterUnility.
 ConvertToExtendedWebElementCollection <AppiumWebElement>(base.FindElements(by));
 public ReadOnlyCollection <AppiumWebElement> FindElementsByAccessibilityId(string selector) =>
 CollectionConverterUnility.
 ConvertToExtendedWebElementCollection <AppiumWebElement>(this.FindElements("accessibility id", selector));
 /// <summary>
 /// Finds a list of elements that match the XPath supplied
 /// </summary>
 /// <param name="xpath">xpath to the element</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <AppiumWebElement> FindElementsByXPath(string xpath) =>
 CollectionConverterUnility.
 ConvertToExtendedWebElementCollection <AppiumWebElement>(base.FindElementsByXPath(xpath));
 /// <summary>
 /// Finds a list of elements that match the DOM Tag supplied
 /// </summary>
 /// <param name="tagName">DOM tag name of the element being searched</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <AppiumWebElement> FindElementsByTagName(string tagName) =>
 CollectionConverterUnility.
 ConvertToExtendedWebElementCollection <AppiumWebElement>(base.FindElementsByTagName(tagName));
 /// <summary>
 /// Finds a list of elements that match the part of the link text supplied
 /// </summary>
 /// <param name="partialLinkText">Part of the link text</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <AppiumWebElement> FindElementsByPartialLinkText(string partialLinkText) =>
 CollectionConverterUnility.
 ConvertToExtendedWebElementCollection <AppiumWebElement>(base.FindElementsByPartialLinkText(partialLinkText));
Beispiel #16
0
 /// <summary>
 /// Finds a list of elements that match the DOM Tag supplied
 /// </summary>
 /// <param name="tagName">DOM tag name of the element being searched</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <W> FindElementsByTagName(string tagName)
 {
     return(CollectionConverterUnility.
            ConvertToExtendedWebElementCollection <W>(base.FindElementsByTagName(tagName)));
 }
Beispiel #17
0
 /// <summary>
 /// Finds a list of elements that match the XPath supplied
 /// </summary>
 /// <param name="xpath">xpath to the element</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <W> FindElementsByXPath(string xpath)
 {
     return(CollectionConverterUnility.
            ConvertToExtendedWebElementCollection <W>(base.FindElementsByXPath(xpath)));
 }
Beispiel #18
0
 /// <summary>
 /// Finds a list of elements that match the link text supplied
 /// </summary>
 /// <param name="linkText">Link text of element</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <AppiumWebElement> FindElementsByLinkText(string linkText)
 {
     return(CollectionConverterUnility.
            ConvertToExtendedWebElementCollection <AppiumWebElement>(base.FindElementsByLinkText(linkText)));
 }
Beispiel #19
0
 /// <summary>
 /// Finds a list of elements that match the name supplied
 /// </summary>
 /// <param name="name">Name of the element on the page</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <AppiumWebElement> FindElementsByName(string name)
 {
     return(CollectionConverterUnility.
            ConvertToExtendedWebElementCollection <AppiumWebElement>(base.FindElementsByName(name)));
 }
 /// <summary>
 /// Finds a list of elements that match the ID supplied
 /// </summary>
 /// <param name="id">ID of the element</param>
 /// <returns>ReadOnlyCollection of elements found</returns>
 public new ReadOnlyCollection <AppiumWebElement> FindElementsById(string id) =>
 CollectionConverterUnility.
 ConvertToExtendedWebElementCollection <AppiumWebElement>(base.FindElementsById(id));