We have an extensive selenium test-suite in java (over 500 selenium tests) running every night. To gain some time, we implemented a mechanism to keep the browser open if the user running the test is the same as the user running the previous test. This results in the browser being openend for long periods of time (longer than 30 minutes).
Firefox, however, tries to refresh it's live bookmarks every 30 minutes. The url it requests is passed to the selenium server proxy, which doesn't have the correct proxy settings for our network. This results the following failure in the log:
org.openqa.selenium.server.ProxyHandler - Could not proxy
http://en-us.fxfeeds.mozilla.com/en-US/firefox/headlines.xml
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.
www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.
www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.
www.http.HttpClient.<init>(HttpClient.java:233)
at sun.net.
www.http.HttpClient.New(HttpClient.java:306)
at sun.net.
www.http.HttpClient.New(HttpClient.java:323)
at sun.net.
www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)
at sun.net.
www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)
at sun.net.
www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
at sun.net.
www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at org.openqa.selenium.server.ProxyHandler.proxyPlainTextRequest(ProxyHandler.java:374)
at org.openqa.selenium.server.ProxyHandler.handle(ProxyHandler.java:250)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
When this happens right after a setTimeout command was triggered (org.openqa.selenium.server.SeleniumDriverResourceHandler - Session 546626 going to doCommand(setTimeout,60000,))
something seems to be screwed up from that point on, since every other setTimeout command (same log statement) results in:
java.lang.RuntimeException: unexpected command cmd=setTimeout&1=60000&2= in place before new command setTimeout could be added.
at org.openqa.selenium.server.CommandQueue.doCommandWithoutWaitingForAResponse(CommandQueue.java:164)
at org.openqa.selenium.server.CommandQueue.doCommand(CommandQueue.java:99)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.doCommand(FrameGroupCommandQueueSet.java:355)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:478)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:375)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:123)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
00:41:04.064 DEBUG [11] org.mortbay.http.HttpConnection - RESPONSE:
HTTP/1.1 500 Internal Server Error
Date: Tue, 15 Apr 2008 22:41:04 GMT
Server: Jetty/5.1.x (Windows XP/5.1 x86 java/1.6.0_04
Connection: close
We managed to work around it by setting the proxy settings for our selenium server so the firefox live bookmark url gets through, but I guess something else is wrong with the exception handling...