Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifier click or keyDown support? #82

Closed
diegomejia opened this issue Mar 14, 2014 · 6 comments
Closed

Modifier click or keyDown support? #82

diegomejia opened this issue Mar 14, 2014 · 6 comments

Comments

@diegomejia
Copy link

There doesn't seem to be a way to hold down a modifier key(Shift, Ctrl, Cmd etc.) and initiate a click. I'm actually not sure if there is a way to implement this using the WebDriverJS API either.

Ideally it would be possible to hold down a modifier key, then do an action, then release the key. For example:

    browser
        .keyDown('SHIFT')
        .click('item')
        .keyUp('SHIFT')

    //Or Possibly...
    browser
        .click('item', 'SHIFT')

Which is like the implementation for a Ruby Webdriver stack seen here:
http://watirwebdriver.com/sending-special-keys/

The closest approximation I could find for this action is through the elementIdValue JsonWireProtocol call. Several keystrokes can be sent together but there is always a NULL appended to the input. So any modifier keys that are held down during the input are reset to the keyUp state when the call terminates. So this doesn't allow for any clicks to be input with a modifier key being held down.

Maybe I'm just missing something.

@beatfactor
Copy link
Member

Thanks for submitting this, I'll add it to the list.

@beatfactor beatfactor changed the title Modified click or keyDown support? Modifier click or keyDown support? Mar 17, 2014
@beatfactor
Copy link
Member

since v0.4.9 you can use the keys command for this purpose.

@diegomejia
Copy link
Author

Awesome thanks!

@ramanamatya
Copy link

how do we trigger ctrl space from that keys event.
Can u show some example.

Thank you.

@chin2km
Copy link

chin2km commented Nov 6, 2017

@ramanamatya Hey! Did you find a way to test ctrl+ some other action with nightwatch?

@applefreak
Copy link

@chin2km I Landed on this issue while encountering the same problem. I guess you can use execute and client side JS to achieve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants