title: Unable to click on google's search result through selenium web driver (Java)
body: <p>I am trying to search some thing on google, lets say "Testing". So I want to click on 1st search result, but unable to do that. Please find my code below. I have tried with xpath, class and cssSelector. Please help.:</p>
  
  <pre><code>/**
   * @param args
   * @throws InterruptedException
   */
  public static void main(String[] args) throws InterruptedException {
      // TODO Auto-generated method stub
  
      WebDriver driver = new FirefoxDriver();
      driver.manage().window().maximize();
      driver.get("https://www.google.co.in/");
  
      driver.findElement(By.id("lst-ib")).sendKeys("Testing" + Keys.ENTER);
      Thread.sleep(5);
  
      driver.findElement(
              By.className("r"))
              .click();
  }
  </code></pre>
  
  <p>Please find the Inspect Element result as well:</p>
  
  <p>Software testing - Wikipedia, the free encyclopedia</p>