You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.
What steps will reproduce the problem?
1. Have a simple test that includes the following code (in an attempt to make a new
tab in Firefox; whether this in itself is recommended or not is irrelevant to the issue
in question, but I would like to hear feedback if there is any)
new Actions(this.driver)
.keyDown(Keys.COMMAND)
.sendKeys("t")
.keyUp(Keys.COMMAND)
.perform();
where this.driver is an instance of FirefoxDriver, Actions is org.openqa.selenium.interactions.Actions
and Keys is org.openqa.selenium.Keys.
2. Run the test
What is the expected output? What do you see instead?
I'm expecting that a new tab opens in Firefox. Instead, I get a failed tests, with
a new IllegalArgumentException("Key Down / Up events only make sense for modifier keys.")
thrown from inside org/openqa/selenium/interactions/internal/SingleKeyAction.java
The apple command key should be a valid modifier key, but the enum in the aforementioned
class only defines shift, ctrl and alt as modifier keys.
Selenium version: 2.14.0
OS: Mac OS X 10.7.2
Browser: Firefox
Brower version: 8.0.1
Here's a diff that fixes this issue:
java/client/src/org/openqa/selenium/interactions/internal/SingleKeyAction.java
Index: java/client/src/org/openqa/selenium/interactions/internal/SingleKeyAction.java
===================================================================
--- java/client/src/org/openqa/selenium/interactions/internal/SingleKeyAction.java (revision
15246)
+++ java/client/src/org/openqa/selenium/interactions/internal/SingleKeyAction.java (working
copy)
@@ -28,7 +28,7 @@
*/
public abstract class SingleKeyAction extends KeysRelatedAction {
protected final Keys key;
- private static final Keys[] MODIFIER_KEYS = {Keys.SHIFT, Keys.CONTROL, Keys.ALT};
+ private static final Keys[] MODIFIER_KEYS = {Keys.SHIFT, Keys.CONTROL, Keys.ALT,
Keys.COMMAND};
protected SingleKeyAction(Keyboard keyboard, Mouse mouse, Keys key) {
this(keyboard, mouse, null, key);
Reported by azolotkov on 2011-12-21 13:02:45
The text was updated successfully, but these errors were encountered:
Keys.COMMAND is recognized as a modifier (I was just running some copy+paste tests with
it yesterday). There are two things preventing you from seeing your desired behavior:
1. OSX does not support native key events, so the FXDriver simulates all key presses.
This means the key press is contained within the "content" window, so the browser probably
never sees the COMMAND+T as it would from a native event.
2. This is actually more important than 1... we disable tabbed browsing for the FirefoxDriver
so window switching could work. We could support tabbed browsing, but no one has ever
updated the code.
Originally reported on Google Code with ID 3101
Reported by
azolotkov
on 2011-12-21 13:02:45The text was updated successfully, but these errors were encountered: