My issue is related to this question Disable physical mouse and keyboard in selenium but I didn't see an answer for this question.

tests are being ran by Java + Selenium + Chrome on the same user's machine (we don't have server to run the automation tests on, due to employer cost reasons). I have dual monitors so I ran the automation on one of the monitors, and tried to do something else on the other monitor but selenium kept taking away my physical mouse.

Any help/guidance or info on how to resolve this issue is appreciated.

  • How are you running the tests?
    – Brian
    Commented Jan 31, 2020 at 21:21

1 Answer 1


Selenium does not "take mouse from you" it can however switch focus to a browser window if certain conditions happens (usually when new tab opens). To avoid this i suggest you run your tests in headless mode. To run your tests in this mode you need to set chrome options as following:

  chromeOptions = new ChromeOptions();

Of course this means you will not see the actual test being run in a browser window, instead a command line window will open, which you can minimize and continue your work.

  • This still steals the focus. Commented Mar 5, 2023 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.