private static By newSelector(SelectorType selectorType, String selector) {
        switch (selectorType) {
            case className:
                return By.className(selector);
            case cssSelector:
                return By.cssSelector(selector);
            case id:
                return By.id(selector);
            case linkText:
                return By.linkText(selector);
            case name:
                return By.name(selector);
            case partialLinkText:
                return By.partialLinkText(selector);
            case tagName:
                return By.tagName(selector);
            case xpath:
                return By.xpath(selector);
        }
        return null;
    }