I am using Selenium in Chrome with Python to automate some testing and part of that is moving the mouse, as I am creating a lot of test I run them in parallel on threads. The only piece of code that really gives me problems are the following:
action = selenium.webdriver.common.action_chains.ActionChains(driver)
action.move_by_offset(x,y)
action.perform()
For some reason sometime the above will take at least 5 seconds, e.g. 5.03123 seconds, to execute. When there is a delay it is always only slightly above 5, but never below 5, which leads me to believe that somewhere there is a time.sleep(5). I have checked the selenium actionchains file and commented out:
self.w3c_actions.key_action.pause()
in case this was the culprit, but there has been no significant change.
An important note is that this seems to be a larger problem/occurring more often when my window is minimized and I have multiple threads running.
I am very much at a loss on why this happens, and have tried a bunch of different things/test, but basically to no avail. Any and all help is much appreciated.
If you need any additional information or I should run other specific tests let me know and I will.