Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9108663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:51:38+00:00 2026-06-17T02:51:38+00:00

I am working to convert some Selenium tests to use Selenium grid and am

  • 0

I am working to convert some Selenium tests to use Selenium grid and am running into a problem.

The tests run fine using a browser on the local machine.

I created a new driver like this (in spec_helper.rb):

Capybara.register_driver :selenium_remote do |app|
  caps = Selenium::WebDriver::Remote::Capabilities.chrome
  Selenium::WebDriver.for(:remote, 
    :url => 'http://gridhub:4444/grid/driver', 
    :desired_capabilities => caps)
end

When I run the tests with the new driver the hub is contacted and a node loads the Chrome driver, everything looks ok on the grid side.

The problem is that on the machine initiating the tests I am getting the following exception:

Failure/Error: Unable to find matching line from backtrace
     SystemStackError:
       stack level too deep
# /home/.rvm/gems/ruby-1.9.3-p194/gems/capybara-2.0.1/lib/capybara.rb:298

I created this bare bones test, and I am still seeing the same exception just running it:

Capybara.default_driver = :selenium_remote

describe 'I can' do
  it 'visit Google without throwing an error' do        
    visit 'http://www.google.com'
  end
end

I am using Selenium server standalone 2.26.0, Capybara 2.0.1 and RSpec 2.9.0.

Any ideas what is causing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:51:39+00:00Added an answer on June 17, 2026 at 2:51 am

    Well, with the help of this blog post (http://www.softr.li/blog/2012/11/08/capybara-selenium-rspec-vagrant-remotely) I got it working.

    The above blog post was based on another blog post (http://www.without-brains.net/blog/2012/08/01/capybara-and-selenium-with-vagrant).

    It looks like I was registering the Capybara Selenium web driver incorrectly.

    Below is the code from the blog post that correctly registers the driver. Just using it as-is fixed my issue, then I modified it for my own use.

    The code is also in a gist (https://gist.github.com/4038197#file-capybara_remote-rb).

    Create a new Ruby file, add this code, and include it in your spec_helper.rb file.

    # SELENIUM_SERVER is the IP address or hostname of the system running Selenium
    # Server, this is used to determine where to connect to when using one of the
    # selenium_remote_* drivers
    SELENIUM_SERVER = "10.10.11.1"
    
    # SELENIUM_APP_HOST is the IP address or hostname of this system (where the
    # tests run against) as reachable for the SELENIUM_SERVER. This is used to set
    # the Capybara.app_host when using one of the selenium_remote_* drivers
    SELENIUM_APP_HOST = "10.10.11.2"
    
    # CAPYBARA_DRIVER is the Capybara driver to use, this defaults to Selenium with
    # Firefox
    CAPYBARA_DRIVER = "selenium_remote_firefox"
    
    # At this point, Capybara.default_driver is :rack_test, and
    # Capybara.javascript_driver is :selenium. We can't run :selenium in the Vagrant box,
    # so we set the javascript driver to :selenium_remote_firefox which we're going to
    # configure.
    Capybara.javascript_driver = :selenium_remote_firefox
    
    RSpec.configure do |config|
    
      config.before(:each) do
        if selenium_remote?
          Capybara.app_host = "http://#{SELENIUM_APP_HOST}:#{page.driver.rack_server.port}"
        end
      end
    
      config.after(:each) do
        Capybara.reset_sessions!
        Capybara.use_default_driver
        Capybara.app_host = nil
      end
    
      # Determines if a selenium_remote_* driver is being used
      def selenium_remote?
        !(Capybara.current_driver.to_s =~ /\Aselenium_remote/).nil?
      end
    end
    
    # CapybaraDriverRegistrar is a helper class that enables you to easily register
    # Capybara drivers
    class CapybaraDriverRegistrar
    
      # register a Selenium driver for the given browser to run on the localhost
      def self.register_selenium_local_driver(browser)
        Capybara.register_driver "selenium_#{browser}".to_sym do |app|
          Capybara::Selenium::Driver.new(app, browser: browser)
        end
      end
    
      # register a Selenium driver for the given browser to run with a Selenium
      # Server on another host
      def self.register_selenium_remote_driver(browser)
        Capybara.register_driver "selenium_remote_#{browser}".to_sym do |app|
          Capybara::Selenium::Driver.new(app, browser: :remote, url: "http://#{SELENIUM_SERVER}:4444/wd/hub", desired_capabilities: browser)
        end
      end
    end
    
    # Register various Selenium drivers
    CapybaraDriverRegistrar.register_selenium_remote_driver(:firefox)
    

    Now any RSpec example with the :js => true metadata will use this driver.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to convert some xml into a json object using PHP. This
I'm getting started with using python's mrjob to convert some of my long running
I am working with xstream to convert some XML into Java objects. The XML
I am working on oracle database 9ir2 I need to convert some tables into
I'm working on a project to convert an existing Java web application to use
I'm working on a project that requires to convert html email into text. Below
I have a project working fine under MSVS 2010 SP1. I'm trying to convert
For some reason ToDictionary isn't working. I am using vs.net 2010 and 4.0 XElement
I tried to convert some C code to Java, but it is working slightly
I am trying to convert some actions within a controller to run asynchronously in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.