How to move mouse pointer to element in Selenium with nodejs

15.4k views Asked by At

I am working on nodejs, I have added selenium module. right now I am stuck to click on button. I must need to click by moving mouse pointer to element location. And need to click it. So an anyone tell me how we can use ActionSequence to move mouse at particular x y co-ordinates and hit mouse up and down with selenium.

I have searched but I am getting only Java related solution.

1

There are 1 answers

9
Linh Nguyen On BEST ANSWER

Try ActionSequence.mouseMove? Other commands (mouseUp, mouseDown) you can find in https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/actions_exports_ActionSequence.html too

driver.actions().mouseMove(element).mouseUp().mouseDown().pe‌​rform()

or

driver.actions().mouseMove(element).click().perform()