Safari on windows doesn't work with watir-webdriver

403 views Asked by At

Now that Safari is supported by default, I didn't try to compile my own Safari webdriver.

I downloaded and installed Safari 5.1.7 on my Windows 8.1.

I have the latest version of watir-webdriver and selenium-webdriver installed.

When I tried @browser = Watir::Browser.new(:safari), Safari browser is launched, but I get an exception thrown.

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 `'

I can see the below in the browser.

SafariDriver Client

[  0.009s] [safaridriver.client] Requesting connection at ws://127.0.0.1:65407/wd...
[  0.026s] [safaridriver.client] Request acknowledged; connecting...

Please let me know how to fix this issue.

1

There are 1 answers

1
Željko Filipin On BEST ANSWER

I am sorry to be the one to let you know, but I do not think you will be able to drive Safari on Windows. Well, it is not a big surprise. The current version of Safari for Mac OS is 7.0.2 and the latest supported version for Windows is 5.1.7, so it is not surprise that Selenium has trouble driving it. For more information, take a look at https://github.com/watir/watirbook/blob/master/installation/windows.md#safari