title: Not able to open new tab in Browser using Selenium Webdriver
body: <p>I am trying to open new tab in selenium using below line of code</p>
  
  <pre><code>driver.findElement(By.cssSelector("body")).sendKeys(Keys.chord(Keys.CONTROL, "t"));
  </code></pre>
  
  <p>But tabs is not opening up. Can anyone tell whats wrong in this command?
  Also can any one explain <code>"driver.findElement(By.cssSelector("body"))"</code> used in this command for ? I tried searching but not proper answers</p>
  
  <p>Below complete is not working. It is opening up both gmail and stack overflow in same tab in chrome not opening up new tab</p>
  
  <pre><code>package TestCode;
  
  import java.util.concurrent.TimeUnit;
  
  import org.openqa.selenium.By;
  import org.openqa.selenium.JavascriptExecutor;
  import org.openqa.selenium.Keys;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  
  public class Chrome {
  
      public static void main(String[] args) throws InterruptedException {
          // TODO Auto-generated method stub
  
          System.setProperty("webdriver.chrome.driver","C:\\Akash\\Drivers\\chromedriver.exe");
          WebDriver driver = new ChromeDriver();
          driver.get("https://www.gmail.com");
          String selectLinkOpeninNewTab = Keys.chord(Keys.CONTROL+"t"); 
          driver.findElement(By.tagName("body")).sendKeys(selectLinkOpeninNewTab);
          driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
          driver.get("https://stackoverflow.com/");
          System.out.println("Site open");
      }
  
  }
  </code></pre>