2

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.

4

2 回答 2

1

我遇到了同样的问题,但我可以通过从https://code.google.com/p/selenium/downloads/list更新到 selenium-server-standalone-2.35.0.jar并安装 Firefox 版本 24来解决它在 Ubuntu 12.04 上使用 apt-get(版本为 24.0+build1-0ubuntu0.12.04.1)。

于 2013-09-26T19:50:08.313 回答
1

我回到了 Firefox 17 ESR(扩展支持版本),突然测试恢复了活力(使用 Selenium 服务器 2.33.0)。

这个问题似乎表明 Selenium 服务器和 Firefox 之间的版本不兼容。不幸的是,在有关此问题的文档中找不到太多或任何内容-但话又说回来,正如@Pavel Janicek 所提到的,不推荐使用 Selenium RC。我从CHANGELOG中了解到的是 Selenium 服务器 2.32.0 明确支持 Firefox 10 ESR、17 ESR、19 和 20。对于 2.33.0,没有提及其他浏览器版本,因此官方不支持 Firefox 21+,虽然不是每个人都同意

总结一下:如果您看到此错误,唯一的解决方案可能是在当前 CHANGELOG 中减少支持的浏览器列表,直到您的测试再次运行。

于 2013-07-31T14:50:40.427 回答