I've got a Perl-based Selenium instance running on my Win7 workstation. When I fire up a test script, I get an error "Lock file still present!"

Caused by org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher$FileLockRemainedException: Lock file still present! C:\Users\ME\AppData\Local\Temp\customProfileDir557f5502ab184789aed95c3c1031feff\parent.lock

enter image description here

So far, I have:

How can I resolve this?


First of all... Are you using a Grid? This might be helpful: http://selenium-grid.seleniumhq.org/faq.html - Look for the error message Lock file. You will find a probable answer there.

Also, try a tool which detects locked files and what they are locked by.

Also... Your problem is a known one: http://jira.openqa.org/browse/SRC-507

Maybe you should try updating?

Hope I could help a little. :)

Good luck!

  • I am not using a Grid. What tool to detect locked files do you suggest?
    – KatieK
    May 5 '11 at 17:22
  • You could try this one: download.chip.eu/hu/Unlocker-1.8.7_145537.html Worked for me like a charm...
    – Hannibal
    May 6 '11 at 6:38
  • @katiek:Lock Hunter works well for unlocking files.
    – Tester101
    Jun 1 '11 at 20:23
  • Simply update to the latest version of the Selenium RC! :) That solved my issue.
    – user4623
    Jan 3 '13 at 21:08

Are you sure that the Firefox process itself is killed? Sometimes, closing Firefox isn't enough, you will have to kill the process manually via the task manager. Also, make sure you are using the latest version of Selenium RC. This is what I could find:

"Here is my log on this error: … java Caused by: org.seleniumhq.selenium.server.browserlaunchers.FirefoxChromeLauncher$FileLockRemainedException: Lock file still present! C:\DOKUME1\Semadou\LOKALE1\Temp\customProfileDir9d4a3879bb7d4ca5b75dbbb488ec30b1\parent.lock

Sometimes Selenium Remote Control does not stop Firefox properly on Windows and things get very messy (leaving lock files behind). This does happen when you Ctrl-C while running the test suite for instance.

If you encounter this problem, I would advise you to:

Kill all running Firefox instances and make sure that there is no Firefox process in the task manager (or even better reboot) Delete all the directories: C:\DOCUME1\\LOCALS1\Temp\customProfileDir* While you are at it cleanup C:\DOCUME1\\LOCALS1\Temp as much as possible Run your tests or the demo again

  • I'm pretty sure that rebooting the workstation also killed the Firefox instance. ;)
    – KatieK
    May 4 '11 at 16:05
  • And do you get this error at the first run or only after one or more runs. I am asking this because, as stated above, it could be that the firefox process isn't killed correctly by Selenium itself. May 5 '11 at 9:03
  • After a few successful executions, I now get this error the every time I run Selenium, even the first time the computer comes up.
    – KatieK
    May 5 '11 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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