title: driver.findElement(By.linkText("")) working in one test but throwing exception in another
body: <p>I am trying to write two testng tests in the same class (using Selenium webdriver) - one logs in into the application and the other creates a new account. </p>
  
  <p>These are the steps I am following
  - use @BeforeClass to open the application on firefox browser</p>
  
  <pre><code>@BeforeClass
  public void setUp() throws Exception {
      driver = new FirefoxDriver();
      baseUrl = "http://www.salesforce.com";
      driver.get(baseUrl + "/");
  }
  </code></pre>
  
  <ul>
  <li><p>First test to login into the website</p>
  
  <pre><code>@Test
  public void testLogin() throws Exception {
  driver.findElement(By.id("username")).sendKeys(strUsername);
  driver.findElement(By.id("password")).sendKeys(strPassword);
  driver.findElement(By.id("Login")).click();
  </code></pre>
  
  <p>}</p></li>
  <li><p>Second test to create a new account</p>
  
  <pre><code>@Test
  public void createAccount() throws Exception {
  driver.findElement(By.linkText("Accounts")).click();
  ************************
          ************************
          ************************
          ************************
          ************************
  </code></pre>
  
  <p>}</p></li>
  </ul>
  
  <p>My problem is that when I run this testng test, I get exception in the second test:
  <strong>org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"link text","selector":"Accounts"}</strong></p>
  
  <p>But if I include the command "driver.findElement(By.linkText("Accounts")).click();" in the testLogin() test, it works. I want to run all my tests in the same browser session.</p>
  
  <p>Any input would be appreciated much.
  Thanks.</p>