Re: [wtr-general] undefined method `goto' for nil:NilClass (NoMethodError)

2014-05-16 Thread Oscar Rieken
well
Im going to guess that you are never actually creating the browser before
the step is invoked
try moving the browser creation line into the step, or a hook


On Fri, May 16, 2014 at 7:19 PM, watir webdriver <
watirwebdriver...@gmail.com> wrote:

> Hi,
>
> I'm new to ruby and trying a simple scenario to go to amazon site.
>
> I've created a simple feature file as below :
>
> Feature: Amazon uk Testing
> @AmazonUk
> Scenario: Amazon uk Testing
> Given I am on the "amazon" home page
>
> Step definition:
>  @browser = Watir::Browser.new :firefox
>  Given /^I am on the "(.*?)" home page$/ do |url|
>  @browser.goto "http://www.amazon.co.uk/";
> end
>
> When I run the feature file its launching the firefox but not going to
> amazon site and throwing below error :
> undefined method `goto' for nil:NilClass (NoMethodError)
> ./features/step_definitions/amazon_steps.rb:7:in `/^I am on the "(.*?)"
> home page$/'
>
> Am I missing anything in my config files(hooks.rb or env.rb).Could anyone
> plz help in this ?
>
> Your help is appreciated.
>
> Thanks in-advance.
>
>  --
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Watir General" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to watir-general+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] undefined method `goto' for nil:NilClass (NoMethodError)

2014-05-16 Thread watir webdriver
Hi,

I'm new to ruby and trying a simple scenario to go to amazon site.

I've created a simple feature file as below :

Feature: Amazon uk Testing
@AmazonUk
Scenario: Amazon uk Testing
Given I am on the "amazon" home page

Step definition:
 @browser = Watir::Browser.new :firefox
 Given /^I am on the "(.*?)" home page$/ do |url|
 @browser.goto "http://www.amazon.co.uk/";
end

When I run the feature file its launching the firefox but not going to
amazon site and throwing below error :
undefined method `goto' for nil:NilClass (NoMethodError)
./features/step_definitions/amazon_steps.rb:7:in `/^I am on the "(.*?)"
home page$/'

Am I missing anything in my config files(hooks.rb or env.rb).Could anyone
plz help in this ?

Your help is appreciated.

Thanks in-advance.

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.