please me discover why launching browser, not loading https://www.outbid.com/users/sign_in
require "rubygems" require "rspec" require 'watir-webdriver' @browser = watir::browser.new :firefox describe "outbid login" before(:each) @browser.goto 'https://www.outbid.com/users/sign_in' end "should succesfully login in outbid.com" @browser.text_field(:id=> "login_user_email").set 'outbiduser2@gmail.com' @browser.text_field(:id=> "login_user_password").set 'c0mplex1234' @browser.button(:value=> "log in").click @browser.close end end
env:
windows 7 32 bits firefox 20 [also tried in 8.0] installed - watir, watir-webdriver, selenium-webdriver, rspec.
when run code, following exception:
failures: 1) outbid login should succesfully login in outbid.com failure/error: unable find matching line backtrace nomethoderror: undefined method `goto' nil:nilclass # stuff.rb:9:in `block (2 levels) in <main>'
the problem browser created outside scope of test.
the line
@browser = watir::browser.new :firefox
needs within test.
you want create @ start of each test, include in before-each block:
before(:each) @browser = watir::browser.new :firefox @browser.goto 'https://www.outbid.com/users/sign_in' end
Comments
Post a Comment