nl.hsac.fitnesse.fixture.util.selenium.driverfactory.DriverClassNames Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hsac-fitnesse-fixtures Show documentation
Show all versions of hsac-fitnesse-fixtures Show documentation
Fixtures to assist in testing via FitNesse
package nl.hsac.fitnesse.fixture.util.selenium.driverfactory;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.safari.SafariDriver;
import java.util.Arrays;
public enum DriverClassNames {
CHROME(ChromeDriver.class.getName()),
EDGE(EdgeDriver.class.getName()),
FIREFOX(FirefoxDriver.class.getName()),
SAFARI(SafariDriver.class.getName()),
INTERNET_EXPLORER(InternetExplorerDriver.class.getName());
private final String driverClassName;
DriverClassNames(String driverClassName) {
this.driverClassName = driverClassName;
}
public static String getClassNameFor(String browser) {
return Arrays.stream(DriverClassNames.values()).filter(dcn -> dcn.name().equalsIgnoreCase(browser))
.findFirst().map(dcn -> dcn.driverClassName).orElse(null);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy