Java 类org.openqa.selenium.support.pagefactory.ByAll 实例源码

项目:menggeqa    文件:AppiumByBuilder.java   
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;
        }
    }
}
项目:opensearchserver    文件:Selectors.java   
public final By getBy() {
    switch (type) {
    case CSS_SELECTOR:
        return new By.ByCssSelector(query);
    case XPATH_SELECTOR:
        return new By.ByXPath(query);
    case ID_SELECTOR:
        String[] ids = StringUtils.split(query);
        if (ids.length == 1)
            return new By.ById(query);
        By.ById[] byIds = new By.ById[ids.length];
        int i = 0;
        for (String id : ids)
            byIds[i++] = new By.ById(id);
        return new ByAll(byIds);
    }
    return null;
}
项目:jpagefactory    文件:JPageFactoryAnnotations.java   
protected By buildBysFromFindByOneOf(FindAll 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 ByAll(byArray);
}
项目:opensearchserver    文件:WebDriverHtmlNode.java   
private List<WebElement> getAllWebElements(String... tags) {
    By.ByTagName[] byTagNames = getByTagNameArray(tags);
    if (byTagNames == null)
        return null;
    return node.findElements(new ByAll(byTagNames));
}