Jump to content
CaptainBeardsEyesBeard

How to send an "enter" command via _WD_ElementAction

Recommended Posts

... something like this:

; https://w3c.github.io/webdriver/#keyboard-actions
        _WD_ElementAction($sSession, $oElement, 'value', $sValue & "\uE006")

for other keycodes see here: https://w3c.github.io/webdriver/#keyboard-actions

Edited by Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

. ..only seen now that you edit OP.
instead of passing the xPath string directly into the second parameter ($SearchXpath), first search for the target object using the command:

$oGotElement = _WD_FindElement( ... ),  and then pass the returned value to the second parameter of the _WD_ElementAction:

_WD_ElementAction($sSession, $oGotElement, 'value', $sValue & "\uE006")

 

Edited by Chimp
changed variable name to $oGotElement

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

OK I tried this but it seems to error as I get the msgbox come up

 

$GotElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '/html/body/particle-toolbar/mat-toolbar/div[1]/div[1]')
      _WD_ElementAction($sSession,$GotElement,'key',"\uE006")
      If @error Then
         MsgBox(64, "Debug", "Error sending key enter.")
      EndIf

 

Share this post


Link to post
Share on other sites

try to change 'key' with 'value'


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...