Forum: Ruby on Rails getting selenium working with jruby/sinatra/cucumber/webrat on windows

71477e5162d702dae2a072d66a855fec?d=identicon&s=25 wbsurfver@yahoo.com (Guest)
on 2013-10-09 22:51
(Received via mailing list)
I am trying to run cucumber/webrat with Sinatra on Jruby 1.7.3 (1.9.3)
on
Windows.
It seems to work ok, but when I try to add selenium to webrat. I get the
error shown below.
It seems like it thinks it is in a linux environment or something as the
error happens when it tries to start selenium server and there is a "&"
at
the end of the argument chain. I took a look at capybara but had some
other
similar incomprehensible problem there where the stack dump seemed to go
on
for ever until it ran out of memory. I just want a way to test the
javascript aspects of the sinatra server content.

features/support/env.rb

    ENV['RACK_ENV'] = 'test'

    require 'rubygems'
    require 'rack/test'
    require 'rspec/expectations'
    require 'webrat'
    require "selenium/client"

    require File.join(File.dirname(__FILE__), '../../', 'main.rb')


    Webrat.configure do |config|
    # config.mode = :rack
      config.mode = :selenium
      config.application_port = 4567
      config.application_framework = :sinatra
    end

    class WebratMixinExample
      include Rack::Test::Methods
      include Webrat::Methods
      include Webrat::Matchers

      Webrat::Methods.delegate_to_session :response_code, :response_body

      def app
        # Sinatra::Application
        Main
      end
    end

    World{WebratMixinExample.new}

====================================

> When I run cucumber I get


>unrecognized argument &:
Usage: java -jar selenium-server.jar [-interactive] [options]

-port <nnnn>: the port number the selenium server should use
(default 4444)
-timeout <nnnn>: an integer number of seconds before we should give
up
-interactive: puts you into interactive mode.  See the tutorial for
more details
...
...

Exception: java.lang.ThreadDeath thrown from the
UncaughtExceptionHandler
in thr
ead "Thread-8"
    ←[31mGiven I am viewing the admin page←[90m #
features/simple_example.rb:6←[
0m←[0m
←[31m      Error while running >>java -jar
"c:/jruby-1.7.3/lib/ruby/gems/shared/
gems/webrat-0.7.3/vendor/selenium-server.jar" -port 4444 -timeout 5 &<<
(Runtime
Error)←[0m
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.