All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.hemanthsridhar.support.SearchBy Maven / Gradle / Ivy

There is a newer version: 3.3.2
Show newest version
package com.github.hemanthsridhar.support; /**
 * Created by hemanthsridhar on 1/6/19.
 */

import com.github.hemanthsridhar.builder.CustomPageFactoryFinder;
import com.github.hemanthsridhar.pagefactory.AbstractCustomFindByBuilder;
import org.openqa.selenium.By;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
@CustomPageFactoryFinder(SearchBy.FindByBuilder.class)
public @interface SearchBy {

    String locatorsFile() default "";

    String nameOfTheLocator() default "";

    class FindByBuilder extends AbstractCustomFindByBuilder {
        public By buildIt(Object annotation, Field field) {
            SearchBy findBy = (SearchBy) annotation;
            return buildByFromShortFindBy(findBy);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy