Selenium - "Firefox is already running" error Selenium - "Firefox is already running" error selenium selenium

Selenium - "Firefox is already running" error


When Selenium runs your integration tests, it's literally starting up a new copy of Firefox for each test. If a test gets stuck and there's an existing copy of Firefox running with the same profile, it won't be able to start the next one. (That's a Firefox limitation, not a Selenium one.) You should make sure that:

  • your teardown method is closing the browser each time with Selenium.stop
  • you use timeouts and the WaitFor*() methods to limit the amount of a time a test can spend executing its instructions
  • you're using a separate profile for Selenium to run in (you should get this automagically if you haven't changed any settings) distinct from any other Firefox profiles that may already be on the machine


Perhaps try setting the environment variable MOZ_NO_REMOTE to 1 (or use the -no-remote switch).


We have found that in our case the reason for this was completely unrelated to selenium - firefox itself was just having trouble because it was running on machines with not enough CPU and\or RAM. We upgraded the VM's (e.g added more RAM and CPU) and the problem went away almost completely.