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 8316525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:22:58+00:00 2026-06-08T21:22:58+00:00

I have been trying to implement Selenium webdriver for a couple days to do

  • 0

I have been trying to implement Selenium webdriver for a couple days to do my javascript testing. I have installed and included the gem selenium-webdriver in my Gemfile. A few simple tests pass by adding , js: true to an Rspec test.

Nothing else was necessary: When the tests are run, a Firefox window opens the current page specified earlier in the file with Capybara visit path("/news/#{news_item.id}") and then a button is clicked, displaying a form that was hidden, fields are filled, and a submit button is pressed, no problem. The test passes and the browser closes.

Advancing to more complex tests require me to call methods on the webdriver, but I don’t know how to access it, because I did not explicitly create one. I could, however, if I wanted create my own with driver = Selenium::WebDriver.for :firefox but this causes a second browser instance to open, and it is completely blank rather than opening the page Capybara navigated to.

My question is:
How can I get access to the default webdriver being used so that I can call methods such as empty_stars = driver.find_element(:class, "empty-stars-container") and driver.action.move_to(empty_stars).perform ?

  • 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-08T21:22:59+00:00Added an answer on June 8, 2026 at 9:22 pm

    You can get access to the webdriver in Capybara using:

    page.driver.browser
    

    So you would want to do something like:

    empty_stars = page.driver.browser.find_element(:class, "empty-stars-container")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying for the past two days now to implement Admob ads
For a few weeks now, I have been trying to implement a DFT that
I have been trying to implement an upgrade plan for my Android app which
I have been trying to implement a GlassPane for my games' in-game HUD, but
Hello guys, I have been trying to implement the DSUM function but failed to
I have been having this annoying problem when trying to implement a picture gallery
Im trying to implement an Observer/Observable pattern on an EC2 instance. I have been
I have been trying to implement a CheckBox Node Tree, where the parent nodes
I have been trying to implement hash-tables using uthash.h, following the (excellent) documentation I
I have been trying to implement Nhibernate.Linq 1.0.0.4000 together with Nhibernate 2.1.2.4000. After what

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.