I am just starting on Selenium. I am trying to invoke click actions upon links on a web page, but for some reason, selenium.click() event is not even showing on the intellisense! inside the foreach loop. Below is partial code of what I am trying to do.
IWebDriver driver;
driver = new InternetExplorerDriver();
driver.Navigate().GoToUrl("http://www.google.com");
List<IWebElement> links = new List<IWebElement>();
links= driver.FindElements(By.TagName("a")).ToList();
//driver.FindElement(By.LinkText("YouTube")).Click();
foreach (var link in links)
{
OpenQA.Selenium....;
..
}
Please note that the click works fine in the commented line above the foreach loop. Am I missing a reference?