Something like:
WebElement inputs = driver.findElement(By.tagName("input"));or
List<WebElement> links = driver.findElementsBy(By.tagName("a"));What i wanted was a name/value pair like structure which gives me tagName vs Quantity My Objective is to have a list of these Elements and make a Series of tests associated with them, since different users would have their own unique set of these Elements per page. I hope i got my message across.
32 Answers
You could do something like:
List<WebElement> allElements = driver.findElements(By.xpath("//*"));or
List<WebElement> allElements = driver.findElements(By.cssSelector("*"));Then just sort the list as needed using getTagName or other functions.
4This repo looks promising, as page object generation tool
look at Paul Grandjean Prototype Tool for Configurable Selenium Code Generation