com.github.hemanthsridhar.pagefactory.FileBasedElementLocatorFactory 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
The newest version!
package com.github.hemanthsridhar.pagefactory;
import com.github.hemanthsridhar.builder.CustomAnnotations;
import org.openqa.selenium.SearchContext;
import org.openqa.selenium.support.pagefactory.ElementLocator;
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
import java.lang.reflect.Field;
/**
* @author hemanthsridhar
*/
public class FileBasedElementLocatorFactory implements ElementLocatorFactory {
private final SearchContext searchContext;
private final Object page;
public FileBasedElementLocatorFactory(SearchContext searchContext, Object page) {
this.searchContext = searchContext;
this.page = page;
}
@Override
public ElementLocator createLocator(Field field) {
return new FileBasedElementLocator(searchContext, new CustomAnnotations(field, page));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy