Rediff link text is not displaying | Selenium C# Forum
S
shobha bandaru Posted on 14/12/2018
Hi Gunjan Ji,

here is  mycode:

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
class rediff1
{
public static void Main(string[] args)
{
IWebDriver driver = new ChromeDriver(@"C:\Users\sbandaru\Desktop\example\Drivers");

//ChromeOptions options = new ChromeOptions();
//options.AddAdditionalCapability("useAutomationExtension", false);
//driver = new ChromeDriver(@"C:\Users\sbandaru\Desktop\example\Drivers", options);

driver.Navigate().GoToUrl("http://shopping.rediff.com/?sc_cid=ushome_icon");

//*[@id="popular_cat"]/h3[1]/a
//*[@id="popular_cat"]/h3[12]/a

//*[@id="popular_cat"]/h3[3]/a


string part1 = "//*[@id='popular_cat']/h3[";
string part2 = "]/a";

for (int i = 1; i < 13; i++)
{
string link = driver.FindElement(By.XPath(part1 + i + part2)).Text;
Console.WriteLine("link name:" + i + "----" + link);

}

Console.ReadKey();

}

}
}

G
gunjan Replied on 14/12/2018

Hi Shobha,
This  code  is running  perfectly fine.
Please  try  once  again  and  let  me  know.


S
shobha bandaru Replied on 17/12/2018

Gunjan, 

its working fine in IE only, I didn't realize until I got your response. 
Attached screenshot with error,anyway I will continue work with IE
IE is working fine.
Thanks,
Shobha


G
gunjan Replied on 20/12/2018

Try maximising the browser window because same code is workig fine in my system.


S
shobha bandaru Replied on 20/12/2018

you can close this query.