Browser Testing from Rails console using Capybara and selenium

To begin with you need to install the Capybara gem
gem install capybara
Once the gem is installed you can follow the below mentioned procedure.
nishant@Nishant-Lap:~/Desktop/capybara$ rails c
 
Loading development environment (Rails 3.2.13)
1.9.3p392 :001 > require 'capybara/dsl'
 => true 
1.9.3p392 :002 > include Capybara::DSL
 => Object 
1.9.3p392 :003 > Capybara.default_driver = :selenium
 => :selenium 
1.9.3p392 :004 > visit "http://google.com"
 => "" 
1.9.3p392 :005 > page.fill_in('q', :with => 'nishant nigam')

Comments

Popular posts from this blog

Interview Question on Ruby on Rails

Inserting and Moving elements inside Ruby Array