Use following simple method to get Id attribute using XPath,
public string GetIDxpath(string xPath)
{
string id = driver.FindElement(By.XPath(@" + xPath + @")).GetAttribute("id");
return id;
}
public string GetIDxpath(string xPath)
{
string id = driver.FindElement(By.XPath(@" + xPath + @")).GetAttribute("id");
return id;
}
0 comments