Jump to content

webdriver Actions not hitting Enter key


Recommended Posts

I am trying to hit the Return key without having to use the Send keys. I have the following code and its not hitting the Return key. Am I missing something?

; Press Return 
    $sAction = '{"actions":[{"type": "key", "id": "keyboard_1", "actions": [{"type": "keyDown", "value": "\uE006"},'

    ; Pause
    $sAction &= '{"type": "pause", "duration": 500},'

    ; Release Return 
    $sAction &= '{"type": "keyUp", "value": "\uE006"}]}]}'

    _WD_Action($sSession, "actions", $sAction)

 

Edited by goku200
Link to comment
Share on other sites

Hey @Danp2 thanks for that link. I incorporated that into my script. Actions works as expected on other scenarios but it does not work when the print dialogue box appears in Chrome. Its not activating the Actions. My script just hangs when the Google print options are activated:

__WD_Post: URL=HTTP://127.0.0.1:9515/session/c4f5cc7baeee1aa9fd871dd5a537e884/actions; $sData={"actions": [{"type": "key", "id": "keyboard", "actions": [{"type": "keyDown", "value": "\ue007"}, {"type": "keyUp", "value": "\ue007"}]}]}
__WD_Post ==> Success (0) HTTP status = 200 : ResponseText={"value":null}...

 

Link to comment
Share on other sites

Hi @goku200,

Knowing that you are dealing with the print dialog is an important detail that you failed to initially disclose. Next time, please provide more details in your initial post so that we can better assist you.

This dialog isn't controllable via Webdriver, so you'll need to do one of the following --

  • Use standard Autoit commands to perform the desired action
  • Find a way to accomplish your task without triggering the Print dialog

It's difficult to make further recommendations without knowing more about your situation.

HTH, Dan

Link to comment
Share on other sites

My apologize. So my script basically clicks on a link that opens up the Google Chrome print options

image.thumb.png.683c95d2437d3e2e639061ae7f5aa708.png

And am trying to send the actions by just clicking the enter key. Works fine when I use the Send key, but it requires to have that window focused at all times.

Edited by goku200
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...