I have tried
private string GetId(int index)
{
var xPath = "xpath";
var name = driver.FindElements(By.XPath(xPath)).GetAttribute("href");
return name[0].Text;
}
Error
... does not contain a definition for 'GetAttribute' and no accessible extension method 'GetAttribute' accepting a first argument of type 'ReadOnlyCollection' could be found (are you missing a using directive or an assembly reference?...