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

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

There is a newer version: 3.3.2
Show newest version
package com.github.hemanthsridhar.pagefactory;

import com.github.hemanthsridhar.support.SearchBy;
import org.openqa.selenium.By;

import java.lang.reflect.Field;

/**
 * Created by hemanthsridhar on 1/6/19.
 */
public abstract class AbstractCustomFindByBuilder {

    public abstract By buildIt(Object annotation, Field field);

    protected By buildByFromFindBy(SearchBy findBy) {
        return this.buildByFromShortFindBy(findBy);
    }

    protected By buildByFromShortFindBy(SearchBy findBy) {
        SearchWithJSONProvider searchWithJSON = new SearchWithJSONProvider(findBy.locatorsFile());
        return searchWithJSON.getJSONProvider().getLocator(findBy.nameOfTheLocator());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy