Skip to content

Commit 5561cda

Browse files
authored
Fix modifier keys scope on Java Actions (#10333)
As the defiination in SingleKeyAction.java, the modifier keys are from below array and the description highlight that "if the provided key is none of those, IllegalArgumentException is thrown", so update the code to match the scope. Keys.SHIFT, Keys.CONTROL, Keys.ALT, Keys.META, Keys.COMMAND, Keys.LEFT_ALT, Keys.LEFT_CONTROL, Keys.LEFT_SHIFT [skip ci]
1 parent 11f7dde commit 5561cda

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎java/src/org/openqa/selenium/interactions/Actions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public Actions(WebDriver driver) {
8383
* Note that the modifier key is <b>never</b> released implicitly - either
8484
* <i>keyUp(theKey)</i> or <i>sendKeys(Keys.NULL)</i>
8585
* must be called to release the modifier.
86-
* @param key Either {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}. If the
86+
* @param key Either {@link Keys#META}, {@link Keys#COMMAND}, {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}. If the
8787
* provided key is none of those, {@link IllegalArgumentException} is thrown.
8888
* @return A self reference.
8989
*/
@@ -99,7 +99,7 @@ public Actions keyDown(CharSequence key) {
9999
* <i>Actions.click(element).sendKeys(theKey);</i>
100100
* @see #keyDown(CharSequence)
101101
*
102-
* @param key Either {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}. If the
102+
* @param key Either {@link Keys#META}, {@link Keys#COMMAND}, {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}. If the
103103
* provided key is none of those, {@link IllegalArgumentException} is thrown.
104104
* @param target WebElement to perform the action
105105
* @return A self reference.
@@ -116,7 +116,7 @@ public Actions keyDown(WebElement target, CharSequence key) {
116116
* Performs a modifier key release. Releasing a non-depressed modifier key will yield undefined
117117
* behaviour.
118118
*
119-
* @param key Either {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}.
119+
* @param key Either {@link Keys#META}, {@link Keys#COMMAND}, {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}.
120120
* @return A self reference.
121121
*/
122122
public Actions keyUp(CharSequence key) {
@@ -132,7 +132,7 @@ public Actions keyUp(CharSequence key) {
132132
* <i>Actions.click(element).sendKeys(theKey);</i>
133133
* @see #keyUp(CharSequence) on behaviour regarding non-depressed modifier keys.
134134
*
135-
* @param key Either {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}.
135+
* @param key Either {@link Keys#META}, {@link Keys#COMMAND}, {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}.
136136
* @param target WebElement to perform the action on
137137
* @return A self reference.
138138
*/

0 commit comments

Comments
 (0)