0

我有的; 我有 putty.exe 来访问远程 ubuntu 机器 xxx.xx.xxx.xx。
我想要的是; 我希望当我使用 jenkins 在这台远程机器上运行我的测试用例时,它会启动一个浏览器,我可以看到它在我的 windows 机器上弹出。
我尝试过的;我曾尝试将 firefox 与 Xvfb(都位于远程机器上)一起使用,但那是无头的,我看不到错误,我无法从报告中获得太多帮助。我想看看 UI 上发生了什么
所以我想使用远程 webdriver。我试图在远程机器上注册为;使用 putty.exe

sudo java -jar selenium-server-standalone-2.35.0.jar -role node  -hub http://localhost/xxx.xx.xxx.xx:4444/grid/register

但这给出了错误:

Sep 27, 2013 9:24:24 AM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid node
Sep 27, 2013 9:24:24 AM org.openqa.grid.internal.utils.SelfRegisteringRemote startRemoteServer
WARNING: error getting the parameters from the hub. The node may end up with wrong timeouts.The target server failed to respond
09:24:24.961 INFO - Java: Oracle Corporation 23.7-b01
09:24:24.962 INFO - OS: Linux 3.5.0-21-generic amd64
09:24:24.971 INFO - v2.35.0, with Core v2.35.0. Built from revision c916b9d
09:24:25.111 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:5555/wd/hub
09:24:25.113 INFO - Version Jetty/5.1.x
09:24:25.114 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
09:24:25.115 INFO - Started HttpContext[/selenium-server,/selenium-server]
09:24:25.116 INFO - Started HttpContext[/,/]
09:24:36.415 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@49af0a45
09:24:36.416 INFO - Started HttpContext[/wd,/wd]
09:24:36.423 INFO - Started SocketListener on 0.0.0.0:5555
09:24:36.426 INFO - Started org.openqa.jetty.jetty.Server@1f4a8824
09:24:36.428 INFO - using the json request : {"class":"org.openqa.grid.common.RegistrationRequest","capabilities":[{"platform":"LINUX","seleniumProtocol":"Selenium","browserName":"*firefox","maxInstances":5},{"platform":"LINUX","seleniumProtocol":"Selenium","browserName":"*googlechrome","maxInstances":5},{"platform":"LINUX","seleniumProtocol":"Selenium","browserName":"*iexplore","maxInstances":1},{"platform":"LINUX","seleniumProtocol":"WebDriver","browserName":"firefox","maxInstances":5},{"platform":"LINUX","seleniumProtocol":"WebDriver","browserName":"chrome","maxInstances":5},{"platform":"LINUX","seleniumProtocol":"WebDriver","browserName":"internet explorer","maxInstances":1}],"configuration":{"port":5555,"register":true,"host":"10.158.96.150","proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","maxSession":5,"role":"node","hubHost":"localhost","registerCycle":5000,"hub":"http://localhost/184.73.224.98:4444/grid/register","hubPort":-1,"url":"http://10.158.96.150:5555","remoteHost":"http://10.158.96.150:5555"}}
09:24:36.430 INFO - Starting auto register thread. Will try to register every 5000 ms.
09:24:36.430 INFO - Registering the node to hub :http://localhost:-1/grid/register
09:24:36.446 INFO - couldn't register this node : Error sending the registration request.
09:24:41.479 INFO - couldn't register this node : Hub is down or not responding: Hub is down or not responding.

我已经尝试过: http ://rationaleemotions.wordpress.com/2012/01/23/setting-up-grid2-and-working-with-it/ https://code.google.com/p/selenium/wiki /Grid2
了解在 EC2 上运行的 Selenium Grid2 实现

但是当我必须在远程 ubuntu 机器上注册一个节点时,这些在初始步骤中失败了。

4

1 回答 1

0

它并不完全清楚你的错误是什么。这可能有助于您使用 ssh 隧道 vnc 到无头 Xvfb 盒子上

在远程服务器上安装任何丢失的软件包后

Xvfb -screen 0 800x600x16 -ac &
export DISPLAY=:0
xterm &
java -jar selenium-server-standalone-2.35.0.jar -role node  -hub http://mywebsiteip:4444/grid/register

然后从您自己的机器隧道到您的服务器

ssh -l kaltpost -L 5900:localhost:5900 mywebsiteip 'x11vnc -localhost -display :0'

这将等待,所以在另一个终端

vncviewer localhost&

全部取自这里http://gpio.kaltpost.de/?page_id=84

++edit 我刚刚看到您使用主机的 ip 启动了 selenium 服务器,当您将测试连接到它时,这需要是 localhost,然后是 mywebsite id

于 2013-09-18T21:52:21.420 回答