I'm using Selenium 2.0 web driver. My script keeps failing whenever I try locating something in my page. It throws an exception whether I locate the element by LinkText or by XPath.
driver.FindElement(By.LinkText("Products")).Click();
Selenium.ProductPricing.TheUntitledTest:
OpenQA.Selenium.NoSuchElementException : Unable to locate element: {"method":"link text","selector":"Products"}
driver.FindElement(By.XPath("//div[@id='nav']/ul/li[1]/a")).Click();
Selenium.ProductPricing.TheUntitledTest:
OpenQA.Selenium.NoSuchElementException : Unable to locate element: {"method":"xpath","selector":"//div[@id='nav']/ul/li[0]/a"}