Ejemplo n.º 1
0
        public IWebElement FindIFrame(string locator)
        {
            var frame = elementFinder.Find(By.TagName("iframe")).FirstOrDefault(e => e.GetAttribute("id") == locator ||
                                                                                e.GetAttribute("title") == locator ||
                                                                                FrameContentsMatch(e, locator));

            return(frame);
        }
Ejemplo n.º 2
0
        public IWebElement FindSection(string locator, Scope scope)
        {
            var xpath = xPath.Format(".//*[" + xPath.TagNamedOneOf(sectionTags) + " and (" +
                                     "./*[" + xPath.TagNamedOneOf(headerTags) + " and normalize-space() = {0} ] or " +
                                     "@id = {0}" +
                                     ")]", locator.Trim());

            return(elementFinder.Find(By.XPath(xpath), scope));
        }
Ejemplo n.º 3
0
 private IWebElement FindRadioButtonFromValue(string locator, Scope scope)
 {
     return(elementFinder.Find(By.XPath(".//input[@type = 'radio']"), scope).FirstOrDefault(e => e.GetAttribute("value") == locator));
 }
Ejemplo n.º 4
0
 private IEnumerable <IWebElement> Find(By by)
 {
     return(elementFinder.Find(by));
 }
Ejemplo n.º 5
0
 private IWebElement FindFrameByTag(string locator, Scope scope, string tagNameToFind)
 {
     return(WebElement(locator, elementFinder.Find(By.TagName(tagNameToFind), scope)));
 }
Ejemplo n.º 6
0
 private IWebElement Find(By by, Scope scope, Func <IWebElement, bool> predicate = null)
 {
     return(elementFinder.Find(by, scope, predicate));
 }
Ejemplo n.º 7
0
 private IEnumerable <IWebElement> Find(By by, Scope scope)
 {
     return(elementFinder.Find(by, scope));
 }
Ejemplo n.º 8
0
        private IWebElement FindButtonByIdNameOrValue(string locator, Scope scope)
        {
            var xpathToFind = xPath.Format(".//*[@id = {0} or @name = {0} or @value = {0} or @alt = {0}]", locator);

            return(elementFinder.Find(By.XPath(xpathToFind), scope).FirstOrDefault(IsButton));
        }
Ejemplo n.º 9
0
 public IWebElement FindField(string locator, Scope scope)
 {
     return(xPath.FieldXPaths(locator, scope)
            .Select(xpath => elementFinder.Find(By.XPath(xpath), scope))
            .FirstOrDefault(element => element != null));
 }
Ejemplo n.º 10
0
 public IWebElement FindSection(string locator, Scope scope)
 {
     return(FindSectionByHeaderText(locator, scope) ??
            elementFinder.Find(By.Id(locator), scope).FirstDisplayedOrDefault(IsSection));
 }
Ejemplo n.º 11
0
 public IWebElement FindButton(string locator, Scope scope)
 {
     return(elementFinder.Find(By.XPath(xPath.ButtonXPath(locator)), scope));
 }