protected static By createBy(Annotation[] annotations, HowToUseSelectors howToUseLocators) { if (annotations == null || annotations.length == 0) { return null; } switch (howToUseLocators) { case USE_ONE: { return getMobileBy(annotations[0], getFilledValue(annotations[0])); } case BUILD_CHAINED: { return getComplexMobileBy(annotations, ByChained.class); } case USE_ANY: { return getComplexMobileBy(annotations, ByAll.class); } default: { return null; } } }
protected By buildByFromFindBys(FindBys findBys) { FindBy[] findByArray = findBys.value(); By[] byArray = new By[findByArray.length]; for (int i = 0; i < findByArray.length; ++i) { byArray[i] = this.buildByFromFindBy(findByArray[i]); } return new ByChained(byArray); }
public List<WebElement> getTestCaseWidgets() { ByChained chained = new ByChained(By.id(TestSessionContainer.ID), By.className(Constants.BTN)); WebDriverWait wait = new WebDriverWait(driver, 3); wait.until(ExpectedConditions.visibilityOfElementLocated(chained)); List<WebElement> elements = driver.findElements(chained); return elements; }
private List<WebElement> getChainedWebElements(String... path) { By.ByTagName[] byTagNames = getByTagNameArray(path); if (byTagNames == null) return null; return node.findElements(new ByChained(byTagNames)); }