Пример #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);
        }
Пример #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));
        }
Пример #3
0
 private IWebElement FindRadioButtonFromValue(string locator, Scope scope)
 {
     return(elementFinder.Find(By.XPath(".//input[@type = 'radio']"), scope).FirstOrDefault(e => e.GetAttribute("value") == locator));
 }
Пример #4
0
 private IEnumerable <IWebElement> Find(By by)
 {
     return(elementFinder.Find(by));
 }
Пример #5
0
 private IWebElement FindFrameByTag(string locator, Scope scope, string tagNameToFind)
 {
     return(WebElement(locator, elementFinder.Find(By.TagName(tagNameToFind), scope)));
 }
Пример #6
0
 private IWebElement Find(By by, Scope scope, Func <IWebElement, bool> predicate = null)
 {
     return(elementFinder.Find(by, scope, predicate));
 }
Пример #7
0
 private IEnumerable <IWebElement> Find(By by, Scope scope)
 {
     return(elementFinder.Find(by, scope));
 }
Пример #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));
        }
Пример #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));
 }
Пример #10
0
 public IWebElement FindSection(string locator, Scope scope)
 {
     return(FindSectionByHeaderText(locator, scope) ??
            elementFinder.Find(By.Id(locator), scope).FirstDisplayedOrDefault(IsSection));
 }
Пример #11
0
 public IWebElement FindButton(string locator, Scope scope)
 {
     return(elementFinder.Find(By.XPath(xPath.ButtonXPath(locator)), scope));
 }