title: Selenium 2 WebDriver not able to find link
body: <p>I saw the other questions regarding similar/same issues but they did not help me solve the problem :(. I log into the production site .  say ( <a href="http://www.site.com/log" rel="nofollow">http://www.site.com/log</a>) . I want to click on a link after that but Selenium is not able to find the link.  The relevant HTML part is :</p>
  
  <pre><code>&lt;div style="display:none" id="managers"&gt;
               &lt;a class="projectManager" style="color:black"&gt; Project Manager&lt;/a&gt;
  
               &lt;a class="transportManager"&gt; Transport Manager&lt;/a&gt;
           &lt;/div&gt;
  </code></pre>
  
  <p>The java code is below:</p>
  
  <pre><code>import java.util.regex.Pattern;
  import java.util.concurrent.TimeUnit;
  import org.junit.*;
  import static org.junit.Assert.*;
  import static org.hamcrest.CoreMatchers.*;
  import org.openqa.selenium.*;
  import org.openqa.selenium.chrome.ChromeDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  import org.openqa.selenium.remote.DesiredCapabilities;
  import org.openqa.selenium.support.ui.Select;
  
  public class test {
      private WebDriver driver;
      private String baseUrl="";
      private StringBuffer verificationErrors = new StringBuffer();
      @Before
      public void setUp() throws Exception {
          //driver = new FirefoxDriver();
          //driver.manage().timeouts().implicitlyWait(45, TimeUnit.SECONDS);
          DesiredCapabilities chromeCapabilities = DesiredCapabilities.chrome();
  
          String chromeBinary = System.getProperty(" ");
          if (chromeBinary == null || chromeBinary.equals("")) {
              String os = System.getProperty("os.name").toLowerCase().substring(0, 3);
              chromeBinary = "lib/chromedriver-" + os + (os.equals("win") ? ".exe" : "");
              System.setProperty("webdriver.chrome.driver", chromeBinary);
          }
          driver=new ChromeDriver(chromeCapabilities);
          driver.manage().timeouts().implicitlyWait(70,TimeUnit.SECONDS);
      }
  
      @Test
      public void testEmployee() throws Exception {
          driver.get("http://www.site.com/log");
          driver.findElement(By.name("j_username")).clear();
          driver.findElement(By.name("j_username")).sendKeys("username");
          driver.findElement(By.name("j_password")).clear();
          driver.findElement(By.name("j_password")).sendKeys("password");
          driver.findElement(By.cssSelector("input[name=\"login\"]")).click();
          Thread.sleep(10000);
  
          driver.findElement(By.linkText(" Project Manager")).click();
          driver.findElement(By.linkText("Sign Out")).click();
          System.out.println("Test done");
          }
      @After
      public void tearDown() throws Exception {
          driver.quit();
          String verificationErrorString = verificationErrors.toString();
          if (!"".equals(verificationErrorString)) {
              fail(verificationErrorString);
          }
      }
  
      private boolean isElementPresent(By by) {
          try {
              driver.findElement(by);
              return true;
          } catch (NoSuchElementException e) {
              return false;
          }
      }
  }
  </code></pre>
  
  <p>Question: What is the error ? It gives an "element not found" exception </p>
  
  <p>Thanks. </p>