我使用木偶,施加模塊具有設置的Watir環境中使用的Watir的webdriver:上無頭的Centos 6.4(64位)
- EPEL
- 寶石,包{[ '的Watir-webdriver的', '無頭' , '燻肉', '硒的webdriver']:
- phantomJS
- RVM(RVM使用紅寶石-2.1.1)
- xvfb的
- 火狐
現在,如果我運行基本測試:
basic_headless.rb
require 'watir-webdriver'
require 'headless'
headless = Headless.new
headless.start
b = Watir::Browser.start 'www.google.com'
puts b.title
b.close
headless.destroy
打印 「谷歌」
及以下:
#!/usr/bin/ruby
require 'rubygems'
require 'watir-webdriver'
require 'headless'
require 'bacon'
apache_auth = 'https://l_backup:ke0' + vm_name + '/cgi-bin/administrator/customer.cgi'
user_login = 'sales_test'
user_password = 'sst'
puts "Logging into " + vm_name + " with " + user_password
Bacon.extend Bacon.const_get(format) rescue abort "No such formatter: #{format}"
browser = Watir::Browser.new :chrome
browser.window.resize_to(1450, 750)
browser.window.move_to(0, 0)
describe "UI Testing for Coder-Workspace" do
it "Login" do
browser.goto apache_auth
browser.text_field(:id => 'login_input').set user_login
browser.text_field(:id => 'pw_input').set user_password
browser.form(:name => 'loginform').submit
browser.frame(:index => 1).html.should.include 'superuser'
end
顯示錯誤:
/usr/local/rvm/gems/[email protected]/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/chrome/service.rb:50:in `start': unable to connect to chromedriver http://127.0.0.1:9515 (Selenium::WebDriver::Error::WebDriverError)
from /usr/local/rvm/gems/[email protected]/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/chrome/bridge.rb:15:in `initialize'
from /usr/local/rvm/gems/[email protected]/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/common/driver.rb:37:in `new'
from /usr/local/rvm/gems/[email protected]/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/common/driver.rb:37:in `for'
from /usr/local/rvm/gems/[email protected]/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver.rb:67:in `for'
from /usr/local/rvm/gems/[email protected]/gems/watir-webdriver-0.6.8/lib/watir-webdriver/browser.rb:46:in `initialize'
from code_lookup.rb:34:in `new'
from code_lookup.rb:34:in `<main>'
現在,我應該連接到硒服務器?或watir網格?作爲運行測試的代理? 爲什麼試圖連接到chromedriver http://127.0.0.1:9515
我已經在/ usr/bin中chromedriver手動安裝和chmod 777它