unable to run Selenium webdriver in windows - Permission denied - bind(2) (Errno::EACCES)

Posted by mrd abd on Stack Overflow See other posts from Stack Overflow or by mrd abd
Published on 2014-06-02T09:21:04Z Indexed on 2014/06/02 9:25 UTC
Read the original article Hit count: 864

I want to start Selenium web driver in Windows 7 with Ruby 2. but i get error Permission denied - bind(2) (Errno::EACCES) Even in running with Administrator permission.

here is my simple ruby code:

require "selenium-webdriver"
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://google.com"
element = driver.find_element(:name, 'q')
element.send_keys "Hello WebDriver!"
element.submit
puts driver.title
driver.quit

and here is the error:

E:\ruby\930305\Studio\Ruby\test>ruby selenium.rb
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/w    ebdriver/common/port_prober.rb:28:in `initialize': Permission denied - bind(2) (Errno::EACCES)
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/port_prober.rb:28:in `new'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/port_prober.rb:28:in `block in free?'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/port_prober.rb:26:in `each'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/port_prober.rb:26:in `free?'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/port_prober.rb:5:in `above'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/launcher.rb:49:in `find_free_port'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/launcher.rb:33:in `block in launch'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/socket_lock.rb:20:in `locked'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/launcher.rb:32:in `launch'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/bridge.rb:24:in `initialize'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/driver.rb:31:in `new'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/driver.rb:31:in `for'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver.rb:67:in `for'
        from selenium.rb:3:in `<main>'

© Stack Overflow or respective owner

Related posts about ruby

Related posts about windows-7