How to press CTRL+T and CTRL+TAB in selenium WebDriver using Java?
<blockquote>
  <p>Hi All,</p>
  
  <p>For one of my project I need to open a new tab and navigate between
  the tabs for the same I need to know how can I press <kbd>CTRL</kbd>+<kbd>T</kbd> and
  <kbd>CTRL</kbd>+<kbd>TAB</kbd> in Selenium Webdriver using Java.</p>
  
  <p>Please let me know how can I do the same.Thank You...!!!</p>
  
  <p><strong>I'm using the below:</strong></p>
  
  <p><strong>Firefox Version:</strong> 48.0.2</p>
  
  <p><strong>Java Version:</strong> 1.8</p>
  
  <p><strong>Selenium WebDriver Version:</strong> 3.0.0</p>
  
  <p><strong>OS:</strong> Windows 10</p>
</blockquote>

<p><strong>I tried the below code but it doesn't seems to be working:</strong></p>

<pre><code>import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Handling_Tabs {

    public static void main(String[] args) {
        System.setProperty("webdriver.gecko.driver","C:\\Eclipse\\Drivers\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
        driver.get("http://www.google.com/");
        System.out.println(driver.getTitle());
        driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL+"t");
        driver.get("http://www.bing.com/");
        System.out.println(driver.getTitle());
        driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL+"\t");
        System.out.println(driver.getTitle());      
    }
}
</code></pre>