I am getting this error message while running my watir-webdriver tests on Firefox 6 for the first time on Windows XP.
1) Error:
testAttributeGadget010_workflow_shown(AttributeGadgetTest):
Errno::EADDRINUSE: Only one usage of each socket address (protocol/network address/port) is normally permitted. - connect(2)
C:/Ruby187/lib/ruby/1.8/net/http.rb:560:in `initialize'
C:/Ruby187/lib/ruby/1.8/net/http.rb:560:in `open'
C:/Ruby187/lib/ruby/1.8/net/http.rb:560:in `connect'
C:/Ruby187/lib/ruby/1.8/timeout.rb:53:in `timeout'
C:/Ruby187/lib/ruby/1.8/timeout.rb:101:in `timeout'
C:/Ruby187/lib/ruby/1.8/net/http.rb:560:in `connect'
C:/Ruby187/lib/ruby/1.8/net/http.rb:553:in `do_start'
C:/Ruby187/lib/ruby/1.8/net/http.rb:542:in `start'
C:/Ruby187/lib/ruby/1.8/net/http.rb:1035:in `request'
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.4.0/lib/selenium/webdriver/remote/http/default.rb:73:in `response_for'
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.4.0/lib/selenium/webdriver/remote/http/default.rb:41:in `request'
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.4.0/lib/selenium/webdriver/remote/http/common.rb:34:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.4.0/lib/selenium/webdriver/remote/bridge.rb:410:in `raw_execute'
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.4.0/lib/selenium/webdriver/remote/bridge.rb:388:in `execute'
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.4.0/lib/selenium/webdriver/remote/bridge.rb:356:in `find_element_by'
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.4.0/lib/selenium/webdriver/common/search_context.rb:41:in `find_element'
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.2/lib/watir-webdriver/locators/element_locator.rb:86:in `find_first_by_multiple'
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.2/lib/watir-webdriver/locators/element_locator.rb:33:in `locate'
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.2/lib/watir-webdriver/elements/element.rb:263:in `locate'
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.2/lib/watir-webdriver/elements/element.rb:245:in `assert_exists'
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.2/lib/watir-webdriver/elements/checkbox.rb:19:in `set'
./library/attribOptions.rb:22:in `attribOptions'
./library/attribOptions.rb:20:in `each_index'
./library/attribOptions.rb:20:in `attribOptions'
./007_wb_attribute.rb:365:in `testAttributeGadget010_workflow_shown'
./007_wb_attribute.rb:345:in `each'
./007_wb_attribute.rb:345:in `testAttributeGadget010_workflow_shown'
Seems to have happen 20 times out of my 100+ Test/Unit test cases.
Has anyone any idea what is going wrong?
Almost sounds like you're running out of ephemeral ports, which shouldn't really happen with just one Firefox instance. But who knows with Windows. Try increasing the MaxUserPort setting as described here.
Related
I follow a tutorial on how to get started with rails, but end up with different outcome than the video. Here is the message I get back when using the command rails s:
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `initialize': Permission denied - bind(2) for "127.0.0.1" port 3000 (Errno::EACCES)
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `new'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `add_tcp_listener'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:263:in `block in add_tcp_listener'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:262:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:262:in `add_tcp_listener'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:105:in `block in parse'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:88:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:88:in `parse'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/runner.rb:144:in `load_and_bind'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/single.rb:87:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/launcher.rb:172:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/rack/handler/puma.rb:64:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:296:in `start'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/server.rb:79:in `start'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
EDIT:
I am on Windows, and have tried running the command prompt as admin. Same result.
EDIT SOLVED:
technet.microsoft.com/en-us/library/ms345310(v=sql.100).aspx and restart your pc - Chetan Mehta
For ubuntu :
Try running sudo rails s
Make sure you have sudo permissions
If the port is busy, you can try running server on a different port. i.e.:
rails s -p 3001
If you are using window then instead of sudo try running your command prompt as administrator
I'm getting this error on a pretty regular basis: ThreadError: deadlock; recursive locking. I read that if using Unicorn (which I am) that Rack::Lock is not needed. I can remove it by adding config.middleware.delete "Rack::Lock" to application.rb.
Does anyone have opinions on if it is safe to remove Rack::Lock from my production app?
For reference, the common trace:
…dor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/lock.rb:14:in `lock'
…dor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/lock.rb:14:in `call'
…bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/deflater.rb:13:in `call'
…/bundle/ruby/2.0.0/gems/rack-ssl-1.3.3/lib/rack/ssl.rb:27:in `call'
…by/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
…by/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
…by/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
…by/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
…by/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
…by/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:552:in `process_client'
…icorn-worker-killer-0.4.2/lib/unicorn/worker_killer.rb:51:in `process_client'
…icorn-worker-killer-0.4.2/lib/unicorn/worker_killer.rb:124:in `process_client'
…by/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:632:in `worker_loop'
…by/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
…by/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:142:in `start'
Ok, I removed config.middleware.delete "Rack::Lock" about a week ago and all seems to be working ok. The error is gone and removing Rack::Lock has caused no issues.
Env-
64bit Windows 7
ruby 1.9.2-P290
rubygems 1.8.24
Watir 4.0.2
When try to create a browser (Chrome or IE) instance, it will fail with below errors
When try to create a Firefox instance, it will open the Firefox and then close automatically with the same errors.
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'watir-webdriver'
=> true
irb(main):003:0> ie = Watir::Browser.new:chrome
Started ChromeDriver
port=9515
version=23.0.1240.0
log=C:\Users\y93529\chromedriver.log
Selenium::WebDriver::Error::WebDriverError: unexpected response, code=502, conte
nt-type="text/html"
<HEAD><TITLE>Connection refused</TITLE></HEAD>
<BODY BGCOLOR="white" FGCOLOR="black"><H1>Connection refused</H1><HR>
<FONT FACE="Helvetica,Arial"><B>
Description: Connection refused</B></FONT>
<HR>
<!-- default "Connection refused" response (502) -->
</BODY>
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/http/common.rb:66:in `create_response'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/http/default.rb:66:in `request'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/http/common.rb:40:in `call'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/bridge.rb:615:in `raw_execute'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/bridge.rb:92:in `create_session'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/remote/bridge.rb:68:in `initialize'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/chrome/bridge.rb:29:in `initialize'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/common/driver.rb:37:in `new'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver/common/driver.rb:37:in `for'
from C:/ruby/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.27.2/lib/sele
nium/webdriver.rb:67:in `for'
from C:/ruby/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir-we
bdriver/browser.rb:46:in `initialize'
from (irb):3:in `new'
from (irb):3
from C:/ruby/bin/irb:12:in `<main>'
One point to add -
The same environment in 32bit windows 7, everything works good. I doubt if there is some difference of the supporting of webdriver between 64bit win7 and 32bit win7
Any advice will be highly appreciated.
It was solved!
My network has a proxy, when I tried to install the watir, I configured the command line with the proxy, so the command line can download and install watir. After installation, I did NOT delete the proxy that I configured, it was still in the envrionment variables. That's why it fails each time I tried to start a browser with watir-webdriver. Delete this proxy, everything works fine.
Thanks guys for your participate in solving this problem.
In rubymine 4.5.3, I try to run a scenario:
Scenario: I want to buy icecream, then watch a movie
Given I am at a mall
When I buy icecream
Then I should be allowed to watch a movie
The scenario contains a comma, so when I right-click and hit play, the Element Name Filter looks like this:
I want to buy icecream\, then watch a movie
But then I get this stack trace:
too short escape sequence (ArgumentError)
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/options.rb:194:in `block (2 levels) in parse!'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1360:in `call'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1360:in `block in parse_in_order'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1347:in `catch'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1347:in `parse_in_order'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1341:in `order!'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1432:in `permute!'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1453:in `parse!'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/options.rb:119:in `parse!'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/configuration.rb:25:in `parse!'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:55:in `configuration'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:63:in `run_drb_client'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:34:in `execute!'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in `execute'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/bin/cucumber:14:in `<top (required)>'
C:/ruby193/bin/cucumber:23:in `load'
C:/ruby193/bin/cucumber:23:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
To fix the issue I change the Element Name Filter, and remove the backslash:
I want to buy icecream, then watch a movie
Now the scenario runs correctly.
Am I doing something wrong?
EDIT: Just confirmed that the same issue occurs with double-quotes
EDIT: Confirmed the issue still exists in RubyMine 4.5.4
Showing Error while running script by using Firefox
With user of Roo & test/unit
I call information from excel sheet & user in executing but showing error
Showing Error as below
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.9-x86-mingw32/lib/ffi/platform.rb:2
: Use RbConfig instead of obsolete and deprecated Config.
Started ChromeDriver
port=52228
version=20.0.1133.0
log=D:\chromedriver.log
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:141:in `read_nonblock': An existing c
nnection was forcibly closed by the remote host. (Errno::ECONNRESET)
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf_fill'
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_
equest'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1293:in `request'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1064:in `head'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/
elenium/webdriver/chrome/service.rb:62:in `block in stop'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:557:in `start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/
elenium/webdriver/chrome/service.rb:58:in `stop'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/
elenium/webdriver/chrome/service.rb:52:in `block in start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/
elenium/webdriver/common/platform.rb:124:in `block in exit_hook'
Please check whether you have latest ffi gem installed.
gem install ffi
Then give it a shot.