io.nosqlbench.driver.webdriver.verbs.Bys Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of driver-web Show documentation
Show all versions of driver-web Show documentation
A nosqlbench driver module;
Provides the ability to drive steps through the webdriver API.
package io.nosqlbench.driver.webdriver.verbs;
import org.openqa.selenium.By;
import java.util.function.Function;
public enum Bys {
id(By::id),
linkText(By::linkText),
name(By::name),
css(By::cssSelector),
xpath(By::xpath),
classname(By::className);
private Function initializer;
Bys(Function initializer) {
this.initializer = initializer;
}
public static By get(String by) {
Bys bys =classname;
String[] parts = by.split("=", 2);
if (parts.length==2) {
bys= Bys.valueOf(parts[0]);
by = parts[1];
}
return bys.initializer.apply(by);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy