1

I'm running a web application under Tomcat 7, Ubuntu 14.04 that starts an instance of Firefox (currently version 29) using the Java Selenium driver to take screenshots of simple locally defined web pages.

Occasionally, Firefox becomes unresponsive. When this happens there is a "defunct" Firefox instance listed by ps like this:

$ ps -elfwww | grep irefox
0 S tomcat7  18004 17574  0  80   0 - 100490 futex_ 05:31 ?       00:00:01 /usr/lib/firefox/firefox -silent
1 Z tomcat7  18010 18004  0  80   0 -     0 exit   05:31 ?        00:00:00 [firefox] <defunct>

When Firefox is up and running properly it looks more like this:

$ ps -elfwww | grep irefox
0 R tomcat7  19542 17574 38  80   0 - 156275 ?     09:38 ?        00:00:08 /usr/lib/firefox/firefox -foreground

I'm baffled by the different command line options passed to Firefox in these two cases. Why "-silent" vs "-foreground"? What can be done to prevent this?

I'm not seeing any messages about selenium printed in the application's error log.

1 Answers1

0

It seems like it's a common problem (I had it too) with latest versions of Firefox (17+; people say that it works with Firefox 17.0, but I haven't tried) AND the fact that you are creating a new browser instance for every web page you are going to download.

What I did and also what seems to be common logic, is to create just an instance of Firefox, download all your webpages with it and at the end close the browser.

Silviu
  • 637
  • 8
  • 15