title: Why my test is throwing Exception-Unable to locate element in webdriver?
body: <pre><code>package testproject;
  
  import org.openqa.selenium.By;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.firefox.*;
    public class mytestclass {
      public static void main(String[] args) {
         WebDriver Driver = new FirefoxDriver();
          Driver.get("https://www.gmail.com/");
           WebElement wb= Driver.findElement(By.name("Email"));
           wb.sendKeys("sweta");
           WebElement wb1= Driver.findElement(By.name("Passwd"));
           wb1.sendKeys("123456");
           WebElement wb2= Driver.findElement(By.id("signIn"));
           wb2.click();
           WebElement wb3= Driver.findElement(By.xpath(".//*[@id='gb']/div[1]/div[1]/div[2]/div[5]/div[1]/a"));
           wb3.click();
           WebElement wb4= Driver.findElement(By.id("gb_71"));
           wb4.click();
     }
  }
  </code></pre>
  
  <p>When i am executing this code everything is going fine till the point where i want the sign in button to be clicked. I am getting exception which says that 
  Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":".//*[@id='gb']/div[1]/div[1]/div[2]/div[5]/div[1]/a"} but when i am trying to locate it using fierbug its working fine. 
  In the above mentioned code i changed the email id and password to keep the email safe.</p>
  
  <p>I was facing problem with one more program which i already posted on stakwave so if u can then please have a look at this link-<a href="https://stackoverflow.com/questions/21018649/webdriver-is-not-able-to-click-on-a-hyperlink-in-fierfox">webdriver is not able to click on a hyperlink in firefox</a></p>