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); }
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)); }
private IWebElement FindRadioButtonFromValue(string locator, Scope scope) { return(elementFinder.Find(By.XPath(".//input[@type = 'radio']"), scope).FirstOrDefault(e => e.GetAttribute("value") == locator)); }
private IEnumerable <IWebElement> Find(By by) { return(elementFinder.Find(by)); }
private IWebElement FindFrameByTag(string locator, Scope scope, string tagNameToFind) { return(WebElement(locator, elementFinder.Find(By.TagName(tagNameToFind), scope))); }
private IWebElement Find(By by, Scope scope, Func <IWebElement, bool> predicate = null) { return(elementFinder.Find(by, scope, predicate)); }
private IEnumerable <IWebElement> Find(By by, Scope scope) { return(elementFinder.Find(by, scope)); }
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)); }
public IWebElement FindField(string locator, Scope scope) { return(xPath.FieldXPaths(locator, scope) .Select(xpath => elementFinder.Find(By.XPath(xpath), scope)) .FirstOrDefault(element => element != null)); }
public IWebElement FindSection(string locator, Scope scope) { return(FindSectionByHeaderText(locator, scope) ?? elementFinder.Find(By.Id(locator), scope).FirstDisplayedOrDefault(IsSection)); }
public IWebElement FindButton(string locator, Scope scope) { return(elementFinder.Find(By.XPath(xPath.ButtonXPath(locator)), scope)); }