Actions action = new Actions(driver);
WebElement link = driver.findElement(By.linkText("Gmail")); action.moveToElement(link).keyDown(Keys.CONTROL).click(link).build().perform();
Note:
For windows, this is Keys.CONTROL
For Mac, this is Keys.COMMAND
WebElement link = driver.findElement(By.linkText("Gmail")); action.moveToElement(link).keyDown(Keys.CONTROL).click(link).build().perform();
Note:
For windows, this is Keys.CONTROL
For Mac, this is Keys.COMMAND