I am trying send shortcut with Actions.sendKeys, but it isn't work.
(New Actions(driver)).SendKeys(Keys.ALT, Keys.SHIFT, "z");
I am trying send shortcut with Actions.sendKeys, but it isn't work.
(New Actions(driver)).SendKeys(Keys.ALT, Keys.SHIFT, "z");
You can check this question to refer about this - Key press in (Ctrl+A) Selenium WebDriver
Check the answer which uses the chord method, in your case you can do this -
String selectAll = Keys.chord(Keys.ALT, Keys.SHIFT,"z");
driver.findElement(By.tagName("html")).sendKeys(selectAll);
This can also be done using Actions keyUp and keyDown funcitons.
WebDriver driver = new FirefoxDriver();
Actions keyAction = new Actions(driver);
keyAction.keyDown(Keys.ALT).keyDown(Keys.SHIFT).sendKeys("z").keyUp(Keys.ALT).keyUp(Keys.SHIFT).perform();
Try it:
SendKeys.SendWait("%+z")