Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do a mouse wheel in protractor

Is there a way to send out mouse wheel events in protractor? I looked on the web but the only thing i could find was the scrollIntoView method. I really need to be able to invoke wheel events so i can test them.

like image 769
Kenny Tordeur Avatar asked Oct 19 '22 11:10

Kenny Tordeur


1 Answers

There is no "mouse wheel" action specified by the selenium webdriver. You should use .scrollTo(), .scrollBy() and .scrollIntoView() through the browser.executeScript() interface. There is also mouseMove relevant browser action, but that would effectively scroll into view of the element under the hood:

browser.actions.mouseMove(elm).perform();
like image 137
alecxe Avatar answered Oct 27 '22 09:10

alecxe