Cant print the links in a box element | Selenium C# Forum
M
mai Posted on 14/12/2018
Hi
 
For some reason , the count of  links is correct (13)

but display property is false and all links printed are blank 

I have attached my code

G
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();


M
mai Replied on 14/12/2018

thanks Gunjan for your help. I will try it now