I have noticed that while running multiple selenium firefox tests in parallel on a grid that the focus event handling is not working correctly. I have confirmed that when ea
@djangofan: Wrong. You cannot lock the focus. After you requested focus in one window and before you trigger an action, another window requests focus, and your action (like sending keys to input field) just doesn't work. This happened in our tests several times daily. It was hard to reproduce, because with each test run it failed on different places. A solution is to execute each browser in a separate display. E.g. you can use Xvfb:
Xvfb ... -screen 1 1200x800x24 -screen 2 1200x800x24 ...
Then when you start a browser, assign a separate screen to it:
browser.setEnvironmentProperty("DISPLAY", ":N.1");
browser.setEnvironmentProperty("DISPLAY", ":N.2");
...