Actions, input and webdriver: inconsistency or (likely) my own stupidity?

44 views
Skip to first unread message

Tony Mobily

unread,
Jan 18, 2018, 9:13:43 PM1/18/18
to Selenium Users
## Meta -
OS: Ubuntu 
Selenium Version:   Any
Browser:  Any

This is not quite an issue, but... help.
Since there is virtually no documentation on the javascript/node side of the story, I am self-documenting things and making node from the code.
I am stuck at actions. In the [actions.js](https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/lib/actions.js) file I see for example

     dragAndDrop(element, location) {
        return this.mouseDown(element).mouseMove(location).mouseUp();
      }

And:

     click(opt_elementOrButton, opt_button) {
        return this.scheduleMouseAction_('click',
            command.Name.LEGACY_ACTION_CLICK, opt_elementOrButton, opt_button);
      }

What I don't quite get, is the API. The actions.js file has methods like `mouseUp`, `mouseDown`, `mouseMove`, `click`, `keyUp`, `keyDown`, `sendKeys` .

SOME of them, I found in [input.js](https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/lib/input.js), like `keyUp`, `keyDown` (under "keyboard"); confusingly, the pointer ones in input.js have different names (`press`, `release`, `move`...).

THEN SOME of them I find in [webdriver.js](https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/lib/webdriver.js) like (`click`, `sendKeys`, etc.)

Can somebody please explain:

* The relationship between the three files
* Why the inconsistency in naming  and parameter (e.g. `mouseMove(location, opt_offset)` in actions.js  vs `move({x = 0, y = 0, duration = 100, origin = Origin.VIEWPORT})` in input.js 
* How to do things like `dragAndDrop()` _without_ using an action

Thanks in advance, and sorry about the noise. 1 hour on this, and I just don't get it...

Latha Reddy

unread,
May 9, 2019, 6:23:42 AM5/9/19
to Selenium Users
Hello, did you get any solution for this ? If yes could you please share the solution. Because i am also facing the same issue now with actions class
Reply all
Reply to author
Forward
0 new messages