Q:

Disable hardware inputs on Selenium webdriver firefox

I have a ruby script to test a web page in Firefox.  it sends mouse or keyboard events pragmatically to Browser but when hardware mouse is moved, it affects my test. 
How can i configure Firefox to forget hardware mouse and keyboard events? 

A:

You could use Xvfb which will provide a virtual screen for Firefox to open in.  Basically you start Xvfb with a screen number in and point Firefox at that screen by running export DISPLAY=:XX.  You could use PhantomJS but I wouldn't recommend it because it's doubtful that any users will ever use it; better to test with a browser that people use. 
Info on setting up Xvfb
http://www.installationpage.com/selenium/how-to-run-selenium-headless-firefox-in-ubuntu/
How do I run Selenium in Xvfb?