質問

I am totally at a loss here, trying to run a minimal Selenium RC style test. The issue I'm experiencing has been described by a lot of users on the web but none of the widely varying solutions solved the problem in my case. What happens is that Firefox will open, but with what looks like an empty profile to me, because it opens the "Welcome to Firefox!" page. Apart from that, nothing happens in the browser and in the Selenium server log I find this:

DEBUG [12] org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory - Requested browser string '*firefox c:\progra~2\mozill~1\firefox.exe' matches *firefox
DEBUG [12] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Checking whether Firefox 3 launcher at :'c:\progra~2\mozill~1\firefox.exe' is valid...
DEBUG [12] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Discovered valid Firefox 3 launcher  : 'c:\progra~2\mozill~1\firefox.exe'
INFO [12] org.openqa.selenium.server.BrowserSessionFactory - Allocated session 962d2221ccb4459b9adbad1b8734850c for http://www.google.com, launching...
DEBUG [12] org.openqa.selenium.server.browserlaunchers.ResourceExtractor - Extracting /customProfileDirCUSTFFCHROME to C:\Users\zb\AppData\Local\Temp\customProfileDir962d2221ccb4459b9adbad1b8734850c
INFO [12] org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher - Preparing Firefox profile...
INFO [12] org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher - Launching Firefox...
DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for window 'null' local frame 'null' for 1800 more secs
DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for condition for 1000 more ms
DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - got condition? : false

The last three lines are then repeated every second until I stop the Selenium server again.

This is my test code:

import com.thoughtworks.selenium.DefaultSelenium;
public class Runner {
    public static void main(String[] args) {
        DefaultSelenium selenium = new DefaultSelenium("localhost", 4444,
            "*firefox c:\\progra~2\\mozill~1\\firefox.exe", 
            "http://www.google.com");
        selenium.start();
        selenium.open("/");
        selenium.type("q", "test");
        selenium.click("btnK");    
        selenium.stop();
    }
}

I tried:

  • different versions of Firefox (22, 21, 20)
  • different versions of Selenium server (2.33.0, 2.25.0, 2.15.0, a CI build)
  • different versions of the Selenium client driver
  • different versions of the Oracle JDK (1.6u24, 1.6u45, both 32- and 64-bit versions)
  • various Firefox browser launchers in the test code
  • specifying the browser path in the test code or not
  • running Selenium server as Administrator or not
  • various Selenium server options (with/out custom profile, multi-window mode, etc.)
  • different locations for Firefox and the custom profile (i.e. path with/out spaces)
  • a similiar test like the Java one above, written in Perl

It all doesn't help and ends up like I described above. I'm on a Windows 7 machine (64bit). By the way, a small WebDriver test I tried works as expected.

Edit: Renamed question, because the server doesn't actually "hang", it just doesn't work as expected.

役に立ちましたか?

解決

I went back to Firefox 17 ESR (Extended Support Release) and suddenly the tests came back to life (using Selenium server 2.33.0).

This problem seems to be an indicator for version incompatibilites between Selenium server and Firefox. Unfortunately, there's not much, or anything, to be found in the documentation on this matter - but then again, as @Pavel Janicek mentioned, Selenium RC is deprecated. What I've been able to grasp from the CHANGELOG is that Selenium server 2.32.0 explicitly supports Firefox 10 ESR, 17 ESR, 19 and 20. For 2.33.0, no additional browser versions are mentioned, leaving Firefox 21+ officially unsupported, although not everyone agrees.

To wrap it up: If you see this error, the only solution may be to step down the list of supported browsers in the current CHANGELOG until your tests run again.

他のヒント

I hit the same problem, but I could get around it by updating to selenium-server-standalone-2.35.0.jar from https://code.google.com/p/selenium/downloads/list, with Firefox version 24 installed on Ubuntu 12.04 using apt-get (version is 24.0+build1-0ubuntu0.12.04.1).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top