我有一个在Amazon EC2上运行的 Selenium Grid
我有一个基本测试,我正在尝试使用 Ruby 和 TestUnit 运行。
require "test/unit"
require "rubygems"
gem "selenium-client"
require "selenium/client"
class Test3 < Test::Unit::TestCase
def setup
@verification_errors = []
puts "Running tests..."
@selenium = Selenium::Client::Driver.new \
:host => "http://ec2-54-244-205-27.us-west-2.compute.amazonaws.com:7055/wd/hub",
:browser => "*chrome",
:url => "https://news.google.com/",
:timeout_in_second => 60
@selenium.start_new_browser_session
end
def teardown
@selenium.close_current_browser_session
assert_equal [], @verification_errors
end
def test_test3
@selenium.open "/nwshp?hl=en&tab=wn&authuser=0"
@selenium.click "css=#gb_5 > span.gbts"
@selenium.wait_for_page_to_load "30000"
@selenium.click "css=div.main-appbar"
@selenium.click "css=span.titletext"
end
end
但是,我不断收到以下错误:
SocketError: getaddrinfo: nodename or servname provided, or not known
我使用以下行创建了 Selenium Hub。
java -jar selenium-server-standalone-2.6.0.jar -role hub -port 7055
然后我通过执行注册 WebDriver 节点...
java -jar selenium-server-standalone-2.6.0.jar -role webdriver -hub http://ec2-54-244-205-27.us-west-2.compute.amazonaws.com:7055/grid/register -端口 7056
我的网格控制台说...
WebDriverRemoteProxy
listening on http://10.250.11.113:7056/wd/hub
test session time out after 300 sec.
Supports up to 5 concurrent tests from:
我不明白让我的测试与 Selenium Grid 连接。我做错了什么?我的 WebDriver 的 URL 是否应该是 WebDriverRemoteProxy 下的“正在侦听”?