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

com.github.hemanthsridhar.pagefactory.FileBasedElementLocatorFactory Maven / Gradle / Ivy

There is a newer version: 3.3.2
Show 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;

/**
 * Created by hemanthsridhar on 1/6/19.
 */

public class FileBasedElementLocatorFactory implements ElementLocatorFactory {
    private final SearchContext searchContext;

    public FileBasedElementLocatorFactory(SearchContext searchContext) {
        this.searchContext = searchContext;
    }

    @Override
    public ElementLocator createLocator(Field field) {
        return new FileBasedElementLocator(searchContext, new CustomAnnotations(field));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy