Home > Net >  selenium web driver: how to enable mouse move to target elements before clicking or input values?
selenium web driver: how to enable mouse move to target elements before clicking or input values?

Time:05-12

selenium web driver: how to enable mouse move to target elements before clicking or input values?

Mouse is not moved. How to enable it? It should be default behavior for simulating human-machine interaction.

We have so many places for entering values and clicking elements.

CodePudding user response:

The Webdriver implementation does not rely on the actual mouse. It uses low-level browser implementation (through browser native automation drivers like chromedriver or geckodriver) to emulate the mouse interactions. If you take a look at the Webdriver spec, you can see that mouse interactions mention "firing events on nodes" and not actually triggering the mouse itself.

This implementation allows for tests to be run in parallel and/or in headless mode.

So if you call an API like "findSomeElement" and then "click", the result in the browser will be the same as if you had moved your mouse to the element and clicked. Except that your actual mouse pointer won't have moved an inch :)

  • Related