In c# i always use
`IList<IWebElement> SearchResult1 = Setup.driver.FindElements(By.CssSelector("div.comma.line"));`
and i access the SearchResult1
by SearchResult1[0] or SearchResult1 [].
It allow me to click on the SearchResult1[0]
too.
But how am i going to do this in Java. I have this list and cant access the list by its index number.
List<WebElement> matches = TopLayer.findElements(By.tagName("li"));
matches[0]
Im getting an error.