var findById = driver.findElement(By.id("id"))
var findByClass = driver.findElement(By.className("class"))
var findByXpath = driver.findElement(By.xpath("xpath"))
Is there a way to simplify the above code into one line like this:
var dynamicLocator = "id" | "className" | "xpath";
var find = driver.findElement(By.dynamicLocator("something"))
I've been trying different combinations of quotes, but I can't seem to find the right answer.