3
現在,Safari默認支持,我沒有嘗試編譯我自己的Safari webdriver。windows上的Safari瀏覽器不支持watir-webdriver
我在Windows 8.1上下載並安裝了Safari 5.1.7。
我安裝了watir-webdriver和selenium-webdriver的最新版本。
當我試着@browser = Watir::Browser.new(:safari)
,Safari瀏覽器啓動,但我得到一個異常拋出。
irb(main):003:0> @browser = Watir::Browser.new(:safari)
Errno::ECONNABORTED: An established connection was aborted by the software in your host machine.
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/safari/server.rb:37:in `read_nonblock'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/safari/server.rb:37:in `receive'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/safari/bridge.rb:68:in `raw_execute'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/safari/bridge.rb:48:in `create_session'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/remote/bridge.rb:68:in `initialize'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/safari/bridge.rb:27:in `initialize'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/common/driver.rb:47:in `new'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/common/driver.rb:47:in `for'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver.rb:67:in `for'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.8/lib/watir-webdriver/browser.rb:46:in `initialize'
from (irb):3:in `new'
from (irb):3
from C:/Ruby193/bin/irb:12:in `'
我可以在瀏覽器中看到下面的內容。
SafariDriver客戶
[ 0.009s] [safaridriver.client] Requesting connection at ws://127.0.0.1:65407/wd... [ 0.026s] [safaridriver.client] Request acknowledged; connecting...
請讓我知道如何解決這個問題。
非常感謝。沒有wi會停止在Windows上嘗試它。有時間得到一臺Mac。 :d – Navin