JRuby Watir phantomjs exception Unknown error (Windows says: "Operation completed successfully", but it is not.)

Trying to use JRuby with watir-webdriver over the phantomjs driver and get an exception below. Works with: chrome and: firefox, but doesn't work: phantomjs. I tried it on a colleague and also, if failed. Can I use webdriver / phantomjs over JRuby?

Here are the details:

jruby 1.7.12 (1.9.3p392) 2014-04-15 643e292 on Java HotSpot(TM) 64-Bit Server VM 1.7.0-b147 [Windows 7-amd64]

watir-webdriver (0.6.9)

phantomjs -v
1.9.7

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:/jruby-1.7.12/lib/ruby/gems/shared/gems/childprocess-    0.5.3/lib/childprocess/windows/lib.rb:325:in `handle_for'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/childprocess-0.5.3/lib/childprocess/jruby.rb:48:in `windows_handle_for'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/childprocess-0.5.3/lib/childprocess/windows/lib.rb:306:in `handle_for'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/childprocess-0.5.3/lib/childprocess/windows/process_builder.rb:137:in `std_stream_hadle_for'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/childprocess-0.5.3/lib/childprocess/windows/process_builder.rb:109:in `setup_io'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/childprocess-0.5.3/lib/childprocess/windows/process_builder.rb:32:in `start'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/childprocess-0.5.3/lib/childprocess/windows/process.rb:68:in `launch_process'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/childprocess-0.5.3/lib/childprocess/abstract_process.rb:82:in `start'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/phantomjs/service.rb:42:in `start'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/phantomjs/bridge.rb:20:in `initialie'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/common/driver.rb:45:in `for'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver.rb:67:in `for'
    from C:/jruby-1.7.12/lib/ruby/gems/shared/gems/watir-webdriver-0.6.9/lib/watir-webdriver/browser.rb:46:in `initialize'
    from (irb):2:in `evaluate'
    from org/jruby/RubyKernel.java:1101:in `eval'
    from org/jruby/RubyKernel.java:1501:in `loop'
    from org/jruby/RubyKernel.java:1264:in `catch'
    from org/jruby/RubyKernel.java:1264:in `catch'
    from C:/jruby-1.7.12/bin/jirb:13:in `(root)'
+4
source share
1 answer

, , Jruby. , , , watir-webdriver (, , webdriver) jruby. phantomJS .

ruby ​​1.9.3,

C:\Rubies>ruby --version
ruby 1.9.3p551 (2014-11-13) [i386-mingw32]
C:\Rubies>irb
irb(main):001:0> require 'watir-webdriver'
=> true
irb(main):002:0> b = Watir::Browser.new :phantomjs
=> #<Watir::Browser:0x..f887d0e36 url="about:blank" title="">
irb(main):003:0> b.goto "http://google.com"
=> "http://www.google.com/"
irb(main):004:0> puts b.title
Google
=> nil

Windows 8, Jruby, 1.7.19, 9.0.0, , . Ruby 1.9.3 , . 64- Ruby 2.0 (2.0.0p598) 2.1.5 (2.1.5p273), . ( rubygems, ssl, )

, jruby , , ​​, . , phantomJS , jruby , .

, , Jruby .

PS Windows, PIC , RVM 2.0 , URU .

0

Source: https://habr.com/ru/post/1537962/


All Articles