Go down
Posts : 5
Join date : 2012-02-14

OpenQA.Selenium.NoSuchElementException : Unable to find element

on Thu Feb 16, 2012 7:37 pm
Hi All,

When running the following test, im getting the 'NoSuchElementException' in this code line: driver.FindElement(By.LinkText("exact:Wachtwoord vergeten?")).Click();

There are no proxy servers setted in my browsers.
I also tried to set a timeout after driver.Navigate().GoToUrl(baseURL + "/Account/LogOn?"); to wait for 10 sencods before running driver.FindElement(By.LinkText("exact:Wachtwoord vergeten?")).Click();
but still not the same error.

When running the same testcase through RC, it works great.
What is going on here and how can i fix this ? please some advice.

This is my entire code

using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;

namespace SeleniumTests
public class Untitled
private IWebDriver driver;
private StringBuilder verificationErrors;
private string baseURL;

public void SetupTest()
driver = new FirefoxDriver();
baseURL = "";
verificationErrors = new StringBuilder();

public void TeardownTest()
catch (Exception)
// Ignore errors if unable to close the browser
Assert.AreEqual("", verificationErrors.ToString());

public void TheUntitledTest()
driver.Navigate().GoToUrl(baseURL + "/Account/LogOn");
driver.FindElement(By.LinkText("exact:Forget your password?")).Click();
private bool IsElementPresent(By by)
return true;
catch (NoSuchElementException)
return false;
Posts : 41
Join date : 2012-01-13
Age : 30
Location : Germany

Re: OpenQA.Selenium.NoSuchElementException : Unable to find element

on Thu Feb 16, 2012 11:15 pm
try driver.findElement(By.xpath("//......."))

to find the XPath you need firebug and FirePath (its firebug extension mine is version 0.9.7)
Back to top
Permissions in this forum:
You cannot reply to topics in this forum