list webelement count code example Example: count objects in selenium java int xpathCount = webDriver.findElements(By.xpath("Valid_Xpath")).size();