Testing Rspec with Capybara and Selenium
How to set up Capybara and Selenium in ruby on rails application?
First of all add gems into gemfile:
gem 'capybara' gem "selenium-webdriver" gem 'chromedriver-helper'
After Adding new gem, its time to bundle install
bundle install
Now, We need to tell application that we are using capybara with Rspec testing, to do so we need to add following code into rails_helper.rb file
require 'capybara/rspec' require 'capybara/rails'
In order to run test cases in particular browser, need to set default browser.To Set default browser for test suits, Add below code into rails_helper.rb
Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, :browser => :chrome) end
Now we are ready to write test suits for our application but before that if any Error raised like driver not found , to resolve that we would need to install Chromedriver.exe
http://chromedriver.storage.googleapis.com/index.html?path=2.15/ Move downloaded file Chromedriver.exe to C:\ruby\bin folder
This is all about how to set up capybara with selenium, If you are looking for Example, Here is github link Cucumber, capybara, selenium testing
Please log an issue here.
After reading this post, you are able to tell you’re a professional writer with lots of experience.
Just wish to say your article is as surprising. The clarity in your
post is simply nice and i could assume you’re an expert on this subject.
Well with your permission allow me to grab your feed to keep updated with forthcoming post.
Thanks a million and please continue the rewarding work.
Thanks for finally talking about > Testing Rspec with Capybara and Selenium
| Twinkal Savani < Liked it!
Good post however I was wondering if you could
write a litte more on this subject? I’d be very thankful if you
could elaborate a little bit further. Bless you!
I’d like to find out more? I’d love to find out more
details.
Howdy very cool blog!! Man .. Excellent .. Amazing .. I will bookmark your blog and take the feeds additionally…I am happy to find a lot of useful information right here in the submit, we’d like develop more strategies in this regard, thank you for sharing. . . . . .
Thank you for sharing superb informations. Your site is so cool. I am impressed by the details that you¦ve on this website. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for more articles. You, my pal, ROCK! I found simply the info I already searched everywhere and simply couldn’t come across. What a perfect site.
I have been reading out some of your articles and i can state nice stuff. I will definitely bookmark your site.
I like what you guys are up also. Such intelligent work and reporting! Keep up the superb works guys I’ve incorporated you guys to my blogroll. I think it will improve the value of my site 🙂
I have recently started a website, the information you offer on this site has helped me tremendously. Thank you for all of your time & work. “Character is much easier kept than recovered.” by Thomas Paine.
Nice post. I was checking continuously this blog and I’m impressed! Very helpful information specially the last part 🙂 I care for such info much. I was looking for this certain info for a long time. Thank you and best of luck.
This really is a good tip especially to people unfamiliar with the blogosphere.
Simple but very precise information
Good write-up, I?¦m normal visitor of one?¦s site, maintain up the excellent operate, and It is going to be a regular visitor for a lengthy time.
Great blog article. Really Cool.