@Override public List<WebElementFacade> thenFindAll(String xpathOrCssSelector) { logIfVerbose("findAll " + xpathOrCssSelector); List<WebElement> nestedElements; if (isXPath(xpathOrCssSelector)) { nestedElements = findElements((By.xpath(xpathOrCssSelector))); } else { nestedElements = findElements((By.cssSelector(xpathOrCssSelector))); } return webElementFacadesFrom(nestedElements); }
@Override public List<String> getSelectOptions() { List<WebElement> results = Collections.emptyList(); if (getElement() != null) { results = findElements(By.tagName("option")); } return convert(results, new ExtractText()); }
@Override public <T extends WebElementFacade> T findBy(String xpathOrCssSelector) { logIfVerbose("findBy " + xpathOrCssSelector); WebElement nestedElement; if (isXPath(xpathOrCssSelector)) { nestedElement = getElement().findElement((By.xpath(xpathOrCssSelector))); } else { nestedElement = getElement().findElement((By.cssSelector(xpathOrCssSelector))); } return wrapWebElement( driver, nestedElement, timeoutInMilliseconds(), waitForTimeoutInMilliseconds, "element located by " + xpathOrCssSelector); }
@Override public WebElementFacade findBy(By selector) { logIfVerbose("findBy " + selector); WebElement nestedElement = getElement().findElement(selector); return wrapWebElement( driver, nestedElement, timeoutInMilliseconds(), waitForTimeoutInMilliseconds, "element located by " + selector.toString()); }