Instructor
gunjan Replied on 14/12/2018
Hi Mai,
The code is running now. Please find this attached code and try again:
driver.Url = "http://shopping.rediff.com/";
IWebElement boxElement = driver.FindElement(By.XPath("//*[@id='popular_cat']"));
IList<IWebElement> listLinks = boxElement.FindElements(By.TagName("a"));
Console.WriteLine("Total number of links are : " + listLinks.Count);
Console.WriteLine("All links are");
for (int i = 0; i < listLinks.Count; i++)
{
Console.WriteLine(listLinks[i].Text);
}
Console.ReadKey();
thanks Gunjan for your help. I will try it now