I am trying send a shortcut with Actions.sendKeys, but it isn't working.
(New Actions(driver)).SendKeys(Keys.ALT, Keys.SHIFT, "z");
We can send keyboard shortcut ALT SHIFT z(hotkey) with Selenium webdriver. This can be done with the help of the Keys class. We shall use the Keys. chord method and pass Keys.
A shortcut key of a "redo" action is now Ctrl+Y in all Microsoft Office products. However, a lot of other programs like Matlab, Adobe Illustrator, and even old versions of Microsoft Office had "redo" action shortcut key as Ctrl+Shift+Z.
You can check this question to refer about this - Pressing Ctrl+A in 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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With