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

io.nosqlbench.driver.webdriver.verbs.Bys Maven / Gradle / Ivy

Go to download

A nosqlbench driver module; Provides the ability to drive steps through the webdriver API.

There is a newer version: 4.15.102
Show newest version
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