Jump to content

Recommended Posts

Posted

First off, Thank you for hard work on the WebDriver UDF.  I would like to comment on the latest version.  I love Autoit and all that have contributed.  The Function _WD_ElementAction specifically where it was previously used to Send Keyboard keys for example "Enter".  In previous versions a keyboard key like Enter ( "\uE007") could be sent as 

_WD_ElementAction($sSession,$sElement,"value","\uE007")

This would send a keyboard Enter to $sElement.  This works Great.  I do not understand how to do this, _WD_Action($sSession,"actions","\uE007") does Not work.  I realize that I may have to create a Json object to replicate this.  My Solution for now will be to change wd_Core and remove "__WD_EscapeString($sOption)" and replace it with "$sOption"

I always reference back to my "idea of Autoit" and that is to "Simplify windows".  So if WebDriver is to be "W3C" compliant, I would hope that an additional function / option would be created to handle Keyboard Keys.

Here is an Example of what I am commenting on;

=====================================================================================================
Native Autoit Solution;
          Local $hWD=Winactivate("Autoit")
          WinWaitActive($hWD,3)
          Send("{ENTER}")

Old WebDriver Solution;
          _WD_ElementAction($sSession,_WD_FindElement($sSession,"xpath","//*[@id="elSearchField"]"),"value","\uE007")

New WebDriver Solution;
Local $sAction = '{"actions":[{"type": "key", "id": "keyboard_1", "actions": [{"type": "keyDown", "value": "\uE009"}, ' & _
          '{"type": "keyDown", "value": "\uE007"}, {"type": "keyUp", "value": "uE007"}"]}]}'
_WD_Action($sSession, "actions", $sAction)

============================================================================================================

Thank you

RobB

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
×
×
  • Create New...