I have a function that takes a By element, By by = By.xpath("xpathString"). Inside my method I am using the following statement to find another WebElement
findElement(by).findElements(By.xpath(anotherXPathString))
Does anyone know a way to manipulate the first by so I can combine them so I can use one findElement function? I have looked on the Selenium By class page and it has no way to convert a By to a String or to combine to different By elements. My goal is to have it look like
By newby = (however we will combine the two by statements);
findElements(newby);
or
String newXPath = (however we convert the by to a string) + anotherXPathString;
findElements(By.xpath(newXPath));