0

I'm totally perplexed as to why my code below isn't working, basically I have a simple Windows Forms App which runs some WebDriver code, the first part opens a Url, the second part clicks Directory Letter and the third part "the part that's failing" clicks on the first Listing Link, it tries to load the Listing Link page but freezes halfway through, if I stop the Application then the page completes the remainder of the loading which suggests to me that the code is correct. I've no idea while this isn't working so any help would be great.

        var driver = new FirefoxDriver();

        driver.Navigate().GoToUrl("http://www.clpct.com/professionals/services/default.aspx");

        //GET LETTER TO BE CLICKED
        IList<IWebElement> letters = driver.FindElement(By.ClassName("rmHorizontal")).FindElements(By.TagName("a"));
        IWebElement letter = letters[0];
        letter.Click();

        //GET LINK TO BE CLICKED
        IList<IWebElement> links = driver.FindElement(By.ClassName("rtUL")).FindElements(By.TagName("li"));
        IWebElement link = links[0];
        var testLink = link.FindElement(By.ClassName("rtIn"));

        testLink.Click();
chillydk147
  • 151
  • 1
  • 1
  • 8
  • Have you tried using a wait: http://stackoverflow.com/questions/6992993/selenium-c-sharp-webdriver-wait-until-element-is-present – John Koerner Feb 21 '14 at 15:56
  • Tried that, it still freezes – chillydk147 Feb 21 '14 at 15:59
  • I was having a similar issue on my local machine when my versions of firefox autoupdated to the most recent version. Which versions of Firefox and Selenium are you using ? – Ben Feb 21 '14 at 19:00
  • Hi, I'm using Firefox 27.0.1 and selenium 2.5.0 – chillydk147 Feb 21 '14 at 19:55
  • selenium 2.5.0 is very old, switch to newer version, current is 2.40.0 [Changelog](http://code.google.com/p/selenium/source/browse/java/CHANGELOG) – Erki M. Feb 23 '14 at 17:31

0 Answers0