Disable physical mouse and keyboard in selenium



  • I am trying to run an automated test that requires me to move the mouse around the page.

    The problem is that whenever the person running the test moves the physical mouse while the test is running, it interferes with the mouse movements I am trying to do within Selenium+Chrome.

    Is there a way to tell selenium to disable the physical mouse and / or the physical keyboard interactions while running a test?

    By the way, tests are being ran by Java + Selenium + Chrome

    Just to clarify, running this on a separate, dedicated machine without human intervention is not an option. This is something that is required to run on a machine that is being used for other purposes by a human (or any other species that can move a mouse!). Headless will probably be the way to go in the future, but not at the moment.



  • You should not be running tests on a machine used by user(s). Set up a dedicated computer or VM for testing and and use headless browser mode (more info here and here).



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2