Actions KeyDown/KeyUp not supporting all modifier keys
Meta -
OS:
Windows 7/8/10
Selenium Version:
DotNet Webdriver 3.3.0.0
Browser:
Safari
Browser Version:
10
Expected Behavior -
I can use any modifier key in "Actions" methods like "KeyDown/KeyUp"
Actual Behavior -
Only Keys.Shift, Keys.Control, Keys.Alt are supported (See SingleKeyAction.cs)
Steps to reproduce -
new Actions(Driver).KeyDown(Keys.Command).Perform();
The Java WebDriver implementation has this fixed in "SingleKeyAction.java" since march 2014. See: https://github.com/SeleniumHQ/selenium/commit/9b57e72b4a75349b0c52b9010be79c2fa68bebee#diff-b99bb200e128addef65be0b35a8c8612
I am facing the same issue only with firefox3.3.1 and GeckoDriver v0.15.0
I use Actions & Key events for Keyboard shortcuts like undo/redo/delete
actions.keyDown(command).sendKeys("z").keyUp(command).perform();
It works fine in Chrome but not in firefox.
@prakashfrancis you are experiencing this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1332279
Yes @lmtierney .,
It will be fixed in firefox 55
Thanks
@prakashfrancis Right now that's the target, but it could get uplifted to 53
Thats Awesome!
Thanks
Will this be fixed anytime soon? Our tests on safari finally begin to work so this is becomming a real issue now.
It is about the following fragment in "SingleKeyAction.cs".
internal class SingleKeyAction : KeyboardAction
{
private static readonly List<string> ModifierKeys = new List<string>() { Keys.Shift, Keys.Control, Keys.Alt };
The "ModifierKeys" list should be extended to also support the Apple keyboard modifier keys like "Command"
Hi! Will this be fixed anytime soon? It's a very big problem for me because of I am working on tests for macOS applications so I really need work with the "Command" button. My code looks like this:
new Actions(this.driver).KeyDown(Keys.Command).SendKeys("q").KeyUp(Keys.Command).Perform();
but it throws the next exception:
System.ArgumentException : key must be a modifier key (Keys.Shift, Keys.Control, or Keys.Alt)
Parameter name: key
This is an issue with individual vendor webdrivers, please raise an issue with the respective vendor.
@lmtierney thanks. Sorry for misunderstanding, did you mean that I should create an issue in appium-mac-driver repo? I thought that it's a selenium issue because of this functionality works correctly using python.
@mykyta-bondarenko-gl if this is an issue with bindings please raise another issue with a reproducable scenario. As this original issue is state, it is an issue with individual vendor drivers.
Thanks, I've created a new one https://github.com/SeleniumHQ/selenium/issues/5500