Selenium RC:“等待窗口'null'本地帧'null'”

2023-12-30

我在这里完全不知所措,试图运行一个最小的 Selenium RC 风格测试。网上很多用户都描述了我遇到的问题,但没有一个widely不同的解决方案解决了我的问题。发生的情况是 Firefox 将打开,但在我看来是一个空的配置文件,因为它打开了“欢迎使用 Firefox!”页。除此之外,浏览器中没有任何反应,并且在 Selenium 服务器日志中我发现:

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

然后每秒重复最后三行,直到我再次停止 Selenium 服务器。

这是我的测试代码:

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:

  • 不同版本的 Firefox(22、21、20)
  • 不同版本的 Selenium 服务器(2.33.0、2.25.0、2.15.0、CI 版本)
  • 不同版本的 Selenium 客户端驱动程序
  • 不同版本的 Oracle JDK(1.6u24、1.6u45、32 位和 64 位版本)
  • 测试代码中的各种 Firefox 浏览器启动器
  • 是否在测试代码中指定浏览器路径
  • 是否以管理员身份运行 Selenium 服务器
  • 各种 Selenium 服务器选项(带/不带自定义配置文件、多窗口模式等)
  • Firefox 和自定义配置文件的不同位置(即带/不带空格的路径)
  • 与上面的 Java 类似的测试,用 Perl 编写

这一切都没有帮助,最终就像我上面描述的那样。我使用的是 Windows 7 机器(64 位)。顺便说一下,我尝试过的一个小型 WebDriver 测试按预期工作。

Edit:重命名的问题,因为服务器实际上并没有“挂起”,它只是没有按预期工作。


我回到了 Firefox 17 ESR (扩展支持版本 http://www.mozilla.org/en-US/firefox/organizations/faq/)突然测试又恢复了活力(使用 Selenium 服务器 2.33.0)。

这个问题似乎表明 Selenium 服务器和 Firefox 之间版本不兼容。不幸的是,在有关此事的文档中找不到太多或任何内容 - 但话又说回来,正如@Pavel Janicek 提到的,Selenium RC 已被弃用。我能够从中领悟到什么变更日志 http://selenium.googlecode.com/git/java/CHANGELOG是 Selenium 服务器 2.32.0 明确支持 Firefox 10 ESR、17 ESR、19 和 20。对于 2.33.0,没有提及其他浏览器版本,因此官方不支持 Firefox 21+,虽然不是所有人都同意 https://groups.google.com/d/msg/selenium-users/X7lbSPhRYxc/J5m_Ybg0HeYJ.

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Selenium RC:“等待窗口'null'本地帧'null'” 的相关文章

随机推荐