I want to use to drive a web browser for an application I have written. I don’t want to run tests, I want to use the browser to navigate and perform actions. How do I set this up to use capybara command like ‘visit’ ?

I have:

require '-'
require 'capybara'
Capybara.default_driver  =:selenium
d= Selenium::.for :chrome
d.navigate.to('http://www.google.com')
visit('http://www.google.com')
sleep 3

navigate.to works but visit gives me:

main.rb:6:in `<main>': undefined method `visit' for main:Object (NoMethodError)

I’ve tried adding include Capybara::DSL but I get uninitialized constant Capybara::DSL (NameError)



Source link https://sqa.stackexchange.com/questions/33670/how-to-use-capybara-against-an---without--or-rspec

LEAVE A REPLY

Please enter your comment!
Please enter your name here