@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 <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); }