Skip to content

Instantly share code, notes, and snippets.

@joelbyler
Created October 24, 2012 14:20
Show Gist options
  • Save joelbyler/3946336 to your computer and use it in GitHub Desktop.
Save joelbyler/3946336 to your computer and use it in GitHub Desktop.
watir-webdriver hack (maybe only a problem on Windows 7)
# Original solution found as part of this discussion:
# http://code.google.com/p/selenium/issues/detail?id=4020
# This is a monkey patch (aka HACK!) to get watir-webdriver to run on Windows 7.
# This works with watir-webdriver v0.6.1 / selenium-webdriver v2.25.x and may need to be revisited when using later versions
module Selenium
module WebDriver
module Platform
module_function
def interfaces
interfaces = Socket.getaddrinfo("localhost", 8080).map { |e| e[3] }
# fix the problem of binding IPv6
interfaces.delete("0:0:0:0:0:0:0:1")
interfaces += ["0.0.0.0", Platform.ip]
interfaces.compact.uniq
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment