com.github.hemanthsridhar.support.SearchBy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of custom-page-factory Show documentation
Show all versions of custom-page-factory Show documentation
Custom Page Factory to read web elements or mobile elements from JSON
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