List of elements, having this particular name and i need to click on this element Here is my code:
Here it goes: Assuming your myElements will be as below:
List<WebElement> myElements =driver.findElements(By.cssSelector("li[class*='rlbItem']"));
for(WebElement li : myElements)
{
System.out.println(li.getText());
System.out.println();
for (int i=0; i<Name.length(); i++)
{
if(li.getText().equalsIgnoreCase(Name[i]))
{
//Clicks on the matched webelement
li.click();
}
}
}