Package org.openqa.selenium.support

Examples of org.openqa.selenium.support.FindBy


        FindAll findAll = field.getAnnotation(FindAll.class);
        if (ans == null && findAll != null) {
            ans = buildBysFromFindAll(findAll);
        }

        FindBy findBy = field.getAnnotation(FindBy.class);
        if (ans == null && findBy != null) {
            ans = buildByFromFindBy(findBy);
        }

        if (ans == null) {
View Full Code Here


    }

    protected void assertValidAnnotations() {
        FindBys findBys = field.getAnnotation(FindBys.class);
        FindAll findAll = field.getAnnotation(FindAll.class);
        FindBy findBy = field.getAnnotation(FindBy.class);
        if (findBys != null && findBy != null) {
            throw new IllegalArgumentException("If you use a '@FindBys' annotation, " +
                    "you must not also use a '@FindBy' annotation");
        }
        if (findAll != null && findBy != null) {
View Full Code Here

            FindAll findBys = getField().getAnnotation(FindAll.class);
            return buildBysFromFindAll(findBys);
        }

        if (getField().isAnnotationPresent(FindBy.class)) {
            FindBy findBy = getField().getAnnotation(FindBy.class);
            return buildByFromFindBy(findBy);
        }
        return null;
    }
View Full Code Here

        Class<?> fieldClass = getField().getType();
        while (fieldClass != Object.class) {
            if (fieldClass.isAnnotationPresent(Block.class)) {
                Block block = fieldClass.getAnnotation(Block.class);
                FindBy findBy = block.value();
                return buildByFromFindBy(findBy);
            }
            if (fieldClass.isAnnotationPresent(FindBy.class)) {
                return buildByFromFindBy(fieldClass.getAnnotation(FindBy.class));
            }
View Full Code Here

        Class<?> listParameterClass = getGenericParameterClass(getField());
        while (listParameterClass != Object.class) {
            if (listParameterClass.isAnnotationPresent(Block.class)) {
                Block block = listParameterClass.getAnnotation(Block.class);
                FindBy findBy = block.value();
                return buildByFromFindBy(findBy);
            }
            if (listParameterClass.isAnnotationPresent(FindBy.class)) {
                return buildByFromFindBy(listParameterClass.getAnnotation(FindBy.class));
            }
View Full Code Here

                field.getAnnotation(FindBys.class);
        if (by == null && webDriverFindBys != null) {
            by = buildByFromFindBys(webDriverFindBys);
        }

        FindBy findBy = field.getAnnotation(FindBy.class);
        if (by == null && findBy != null) {
            by = buildByFromFindBy(findBy);
        }

        for (Annotation annotation : field.getAnnotations()) {
View Full Code Here

    }

    private By checkAndProcessEmptyFindBy() {
        By result = null;

        FindBy findBy = field.getAnnotation(FindBy.class);
        if (findBy != null) {
            int numberOfValues = assertValidFindBy(findBy);
            if (numberOfValues == 0) {
                result = buildByFromDefault();
            }
View Full Code Here

    }

    private void assertValidAnnotations() {
        FindBys findBys = field.getAnnotation(FindBys.class);

        FindBy findBy = field.getAnnotation(FindBy.class);

        if (findBys != null && findBy != null) {
            throw new IllegalArgumentException("If you use a '@FindBys' annotation, "
                    + "you must not also use a '@FindBy' annotation");
        }
View Full Code Here

    private void initNotPageFragmentsFields(List<Field> fields, Object object) {

        for (Field i : fields) {

            FindBy findBy = i.getAnnotation(FindBy.class);
            final By by = Factory.getReferencedBy(findBy);

            WebElement element = setUpTheProxy(by);

            setObjectToField(i, object, element);
View Full Code Here

    private void initPageFragmentsFields(List<Field> fields, Object object) {
        for (Field pageFragmentField : fields) {

            // sets the root of the Page Fragment, retrieved from annotation
            FindBy findBy = pageFragmentField.getAnnotation(FindBy.class);
            final By by = Factory.getReferencedBy(findBy);

            WebElement rootElement = setUpTheProxy(by);

            // initialise Page Fragment
View Full Code Here

TOP

Related Classes of org.openqa.selenium.support.FindBy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.