private static List<WebElement> findCollection(Collection coll) { System.out.println(coll.getHtmltype().toString()); switch (coll.getHtmltype().toString()) { case "CSS Selector": return SEL_DRIVER.findElements(By.cssSelector(coll.getObjectRule())); case "XPath": return SEL_DRIVER.findElements(By.xpath(coll.getObjectRule())); case "id": return SEL_DRIVER.findElements(By.id(coll.getObjectRule())); case "name": return SEL_DRIVER.findElements(By.name(coll.getObjectRule())); case "title": return SEL_DRIVER.findElements( By.xpath("//*[contains(@title, '" + coll.getObjectRule() + "')]")); default: System.out.println("Did not recognize this type of object"); break; } return null; }