0

我已经在我的本地机器上成功地运行了一个 Selenium Grid,并且我已经将它移到了一个服务器上(windows Server 2008 R2)。

服务器实例已通过本地启动的代理成功运行 服务器托管的控制台在 Internet 上可见

但是,当我在另一台机器上创建一个新的遥控器时,它们构建成功,但它们没有向集线器注册。

命令行是:

ant -Dport=6601 -Dhost=<ip address of my box> -DhubURL=http://ab.cdefg.ca:4444/wd/hub* -Denvironment"firefox" launch-remote-control

我还用我的主机名代替了我的 ip 名 (pc78.subdomain.domain.ca)

如果我没有指定 Denvironment,我会得到以下信息:

      C:\Sgrid\selenium-grid-1.0.8>ant -Dport=6601 -Dhost=pcname.subdomain.domain.ca -Dhu
    bURL=http://ab.cdefg.ca:4444/wd/hub* launch-remote-control
    Buildfile: C:\Sgrid\selenium-grid-1.0.8\build.xml

    launch-remote-control:
         [java] Sep 15, 2011 3:37:11 PM com.thoughtworks.selenium.grid.remotecontrol
    .RegistrationRequest execute
         [java] INFO: Registering to http://ab.cdefg.ca.ca:4444/wd/hub*/registration
    -manager/register
         [java] Exception in thread "main" java.lang.IllegalStateException: Could no
    t register successfuly to http://ab.cdefg.ca.ca:4444/wd/hub*/registration-manage
    r/register with environment '*firefox'. Most likely this environment is not defi
    ned on the hub.
         [java]     at com.thoughtworks.selenium.grid.remotecontrol.RegistrationRequ
    est.execute(RegistrationRequest.java:29)
         [java]     at com.thoughtworks.selenium.grid.remotecontrol.SelfRegisteringR
    emoteControl.register(SelfRegisteringRemoteControl.java:29)
         [java]     at com.thoughtworks.selenium.grid.remotecontrol.SelfRegisteringR
    emoteControlLauncher.main(SelfRegisteringRemoteControlLauncher.java:27)

    BUILD FAILED
    C:\Sgrid\selenium-grid-1.0.8\build.xml:90: Java returned: 1

Total time: 1 second

如果确实指定了 Denvironment,我会得到以下信息:

C:\Sgrid\selenium-grid-1.0.8>ant -Dport=6601 -Dhost=pcname.sub.domain.ca -Dhu
bURL=http://ab.cdefg.ca:4444 -Denvironment"firefox" launch-remote-control
Buildfile: C:\Sgrid\selenium-grid-1.0.8\build.xml

BUILD SUCCESSFUL
Total time: 0 seconds

C:\Sgrid\selenium-grid-1.0.8>

但是,控制台无法识别或使用此代理。该代理在http://localhost:4444/console上也不可见

所以我想,我会反转它并将我的本地用作服务器并尝试将服务器注册为远程控制,但同样的问题再次出现,命令行成功,但功能上没有活动。听起来像网络问题,所以我启动了第三台机器,安装并测试了 selenium 网格(工作)。通过 ipaddress:4444/console 从我的笔记本电脑上可以看到控制台,在我的桌面上运行。

然后我启动了一个遥控器,遇到了同样的问题。好的,然后我关闭本地桌面(将其视为服务器)和笔记本电脑(将其视为远程)上的防火墙。同样的问题。

最后,考虑到本地控制台的存在可能会干扰远程启动,我重新启动并仅运行以下命令:

ant -Dport=6601 -Dhost=<laptop ip> -DhubURL=http://<desktop ip>:4444 -Denvironment"firefox" launch-remote-control

同样的问题。

我也可以从我的桌面 ping 服务器

有没有我缺少的设置?似乎每个实例中的一切都很好,并且所有实例都安装了相同的版本。显然,有些东西并没有从一个地方传到另一个地方,但是当其他一切看起来都还不错时,我不知道如何解决它。非常感谢。

4

2 回答 2

0
ant -Dport=6666 -Dhost=pc78.subdomain.domain.ca -DhubURL=http://ab.cdef.ca:4444 launch-remote-control

感谢您的启动 - 从 DhubURL 中删除“/wd/hub*”并同时删除 Denvironment 实际上让我开始工作 - 感谢您的回复。我

于 2011-09-22T16:55:23.883 回答
0

您需要在环境之后使用“=”。即,-Denvironment="firefox"

于 2011-09-21T12:03:35.343 回答