Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL +"a");
- driver.findElement(By.tagName("body")).sendKeys(Keys.chord(Keys.CONTROL,"a"));
- driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL +"t");
- driver.findElement(By.tagName("body")).sendKeys(Keys.chord(Keys.CONTROL,"n"));
- try {
- Robot robot = new Robot();
- robot.keyPress(KeyEvent.VK_CONTROL);
- robot.keyPress(KeyEvent.VK_T);
- robot.keyRelease(KeyEvent.VK_CONTROL);
- robot.keyRelease(KeyEvent.VK_T);
- } catch (AWTException e) {
- e.printStackTrace();
- }
Add Comment
Please, Sign In to add comment