-
-
Notifications
You must be signed in to change notification settings - Fork 942
Description
Originally reported at http://stackoverflow.com/q/23279945/409820 by a fellow using webdriver via watir-webdriver on windows 7. I was able to duplicate on windows 8 with both jruby 1.7.19 and 9.0.0.0.pre1. OTOH the two lines of IRB code below work just fine on Ruby 1.9.3, Ruby 2.0.0 and Ruby 2.1.5. Only using jruby seems to cause a problem.
Repro: (using watir-webdriver because frankly the repo steps are simpler and cleaner)
- download phantomJS executable from http://phantomjs.org/download.html and place in directory on path.
- gem install watir-webdriver
- In irb issue the following two commands:
require 'watir-webdriver'
b = Watir::Browser.new :phantomJS
Expected: will get a response such as
#<Watir::Browser:0x5a596fa8 url="about:blank" title="">
indicating webdriver has started a phantomjs browser session from which watir-webdriver creates a browser object (to see that the browser object works you could then do b.goto "google.com" followed by puts b.title which ought to return 'Google')
Actual: 'unknown error' with a stack trace as follows
C:\Rubies>irb
io/console not supported; tty will not be manipulated
irb(main):001:0> require 'watir-webdriver'
=> true
irb(main):002:0> b = Watir::Browser.new :phantomjs
ChildProcess::Error: Unknown error (Windows says "The operation completed successfully.", but it did not.)
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/childprocess-0.5.5/lib/childprocess/windows/lib.rb:325:in `handle_for'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/childprocess-0.5.5/lib/childprocess/jruby.rb:48:in `windows_handle_for'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/childprocess-0.5.5/lib/childprocess/windows/lib.rb:306:in `handle_for'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/childprocess-0.5.5/lib/childprocess/windows/process_builder.rb:137:in `std_stream_handle_for'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/childprocess-0.5.5/lib/childprocess/windows/process_builder.rb:109:in `setup_io'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/childprocess-0.5.5/lib/childprocess/windows/process_builder.rb:32:in `start'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/childprocess-0.5.5/lib/childprocess/windows/process.rb:68:in `launch_process'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/childprocess-0.5.5/lib/childprocess/abstract_process.rb:82:in `start'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/phantomjs/service.rb:42:in `start'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/phantomjs/bridge.rb:20:in `initialize'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:45:in `for'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver.rb:67:in `for'
from C:/Rubies/jruby-1.7.19/lib/ruby/gems/shared/gems/watir-webdriver-0.6.11/lib/watir-webdriver/browser.rb:46:in `initialize'
from (irb):2:in `evaluate'
from org/jruby/RubyKernel.java:1107:in `eval'
from org/jruby/RubyKernel.java:1507:in `loop'
from org/jruby/RubyKernel.java:1270:in `catch'
from org/jruby/RubyKernel.java:1270:in `catch'
from C:/Rubies/jruby-1.7.19/bin/jirb:13:in `(root)'irb(main):003:0> exit