I have a same problem. Please help me to correct it. I have put following
code in my hook

Before do
  browser = [:firefox,:chrome,:safari]
  browser.each do |browser|
  $browser = Watir::Browser.new browser
end
end

When i execute my code it opens all 3 browsers but it never executes my
features.
Is there anything i should be putting in to my hook file to execute my
features in each browser one by one


Thanks
Mihir


On Fri, Sep 20, 2013 at 2:16 PM, Dan <[email protected]> wrote:

> I'm pretty sure watirgrid is dead.  Your'e going to want to look at Grid2
> from Selenium.  You don't need the grid just to run across different
> browsers though.
>
>
> On Friday, September 20, 2013 1:34:30 PM UTC-4, Ragavan Ambighananthan
> wrote:
>>
>> Ankita
>>
>> currently i am trying 
>> https://github.com/**90kts/watirgrid<https://github.com/90kts/watirgrid>, 
>> this is originally developed for the same purpose as yours.
>>
>> Regards
>> Ragavan
>>
>> On Friday, September 20, 2013 2:57:22 PM UTC+1, Dan wrote:
>>>
>>> Yeah, that's why I stated I wasn't sure what they were considering a
>>> failure.
>>>
>>>
>>> On Fri, Sep 20, 2013 at 9:52 AM, Oscar Rieken <[email protected]> wrote:
>>>
>>>> To me this doesn't sound like a good test I would probably do something
>>>> more like
>>>>
>>>>
>>>> before do
>>>>    b = (ENV['BROWSER'] ||= 'firefox').downcase
>>>>   @browser = Watir::Browser.new b.to_sym
>>>> end
>>>>
>>>> it "has the correct title" do
>>>>   @browser.goto "place"
>>>>   expect(@browser.title).to eql "something"
>>>> end
>>>>
>>>> then just run it with
>>>> rspec BROWSER=chrome
>>>> rspec BROWSER=ie
>>>> rspec
>>>>
>>>> to me this makes more sense because , sorry if the code doesn't
>>>> actually work did this from memory
>>>>
>>>>
>>>> On Fri, Sep 20, 2013 at 9:08 AM, Dan <[email protected]> wrote:
>>>>
>>>>> Not sure what you're considering a failure, but you'll want to use
>>>>> some exception handling in that case.  See below for an example.  :none is
>>>>> not a valid browser so, it'll fail to initialize it, but keep going with
>>>>> some exception handling.
>>>>>
>>>>> require 'watir-webdriver'
>>>>> browsers = [:none,:firefox,:chrome,:**safari].each do |br|
>>>>> begin
>>>>> b = Watir::Browser.new br
>>>>> b.goto("google.com")
>>>>> puts b.title
>>>>> b.close
>>>>> rescue => e
>>>>> puts e.message
>>>>> next
>>>>> end
>>>>> end
>>>>>
>>>>> On Thursday, September 19, 2013 6:47:54 PM UTC-4, Ankita@Adslot wrote:
>>>>>>
>>>>>> Hi Dan
>>>>>>
>>>>>> Thanks for your reply. This does work if the script runs without any
>>>>>> failure, but, in case any failure happens script stops and does not 
>>>>>> execute
>>>>>> on other browsers.
>>>>>>
>>>>>>  I wanted something where even if script fails on one browser, it
>>>>>> still runs on others to complete the test.
>>>>>>
>>>>>> Your help is much appreciated!
>>>>>>
>>>>>> On Thursday, September 19, 2013 11:07:48 PM UTC+10, Dan wrote:
>>>>>>>
>>>>>>> Not sure what framework you're using or whatever, but you can do
>>>>>>> this pretty easy with a loop.  Below is the basic concept.
>>>>>>>
>>>>>>> require 'watir-webdriver'
>>>>>>> browsers = [:firefox,:chrome,:safari].**eac**h do |br|
>>>>>>> b = Watir::Browser.new br
>>>>>>> b.goto("google.com")
>>>>>>> puts b.title
>>>>>>> b.close
>>>>>>> end
>>>>>>>
>>>>>>> On Wednesday, September 18, 2013 11:57:44 PM UTC-4, Ankita@Adslotwrote:
>>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> Just wondering if there is a way I could automate my script to run
>>>>>>>> on three different browsers one after another...
>>>>>>>>
>>>>>>>> wanted something like
>>>>>>>>
>>>>>>>> Open Browser1 - firefox
>>>>>>>> Run script
>>>>>>>> Close Browser
>>>>>>>> <output>
>>>>>>>> Open Browser2 - ie
>>>>>>>> Run script
>>>>>>>> Close Browser
>>>>>>>> <output>
>>>>>>>> OpenBrowser3- phantomjs
>>>>>>>> Run script
>>>>>>>> Close Browser
>>>>>>>>  <output>
>>>>>>>>
>>>>>>>>
>>>>>>>> I know we could initiate browser of our choice through command
>>>>>>>> prompt and then run the script but just wondering if there is something
>>>>>>>> which could automate the process rather then running the test manually 
>>>>>>>> 3
>>>>>>>> times with three different browsers?
>>>>>>>>
>>>>>>>  --
>>>>> --
>>>>> Before posting, please read http://watir.com/support. In short:
>>>>> search before you ask, be nice.
>>>>>
>>>>> [email protected]
>>>>> http://groups.google.com/**group/watir-general<http://groups.google.com/group/watir-general>
>>>>> watir-genera...@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-genera...@googlegroups.**com.
>>>>>
>>>>> For more options, visit 
>>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>>> .
>>>>>
>>>>
>>>>  --
>>>> --
>>>> Before posting, please read http://watir.com/support. In short: search
>>>> before you ask, be nice.
>>>>
>>>> [email protected]
>>>> http://groups.google.com/**group/watir-general<http://groups.google.com/group/watir-general>
>>>> watir-genera...@googlegroups.**com
>>>>
>>>> ---
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Watir General" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/**
>>>> topic/watir-general/**C9ufcIGfIPY/unsubscribe<https://groups.google.com/d/topic/watir-general/C9ufcIGfIPY/unsubscribe>
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> watir-genera...@googlegroups.**com.
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>
>>>
>> On Friday, September 20, 2013 2:57:22 PM UTC+1, Dan wrote:
>>>
>>> Yeah, that's why I stated I wasn't sure what they were considering a
>>> failure.
>>>
>>>
>>> On Fri, Sep 20, 2013 at 9:52 AM, Oscar Rieken <[email protected]> wrote:
>>>
>>>> To me this doesn't sound like a good test I would probably do something
>>>> more like
>>>>
>>>>
>>>> before do
>>>>    b = (ENV['BROWSER'] ||= 'firefox').downcase
>>>>   @browser = Watir::Browser.new b.to_sym
>>>> end
>>>>
>>>> it "has the correct title" do
>>>>   @browser.goto "place"
>>>>   expect(@browser.title).to eql "something"
>>>> end
>>>>
>>>> then just run it with
>>>> rspec BROWSER=chrome
>>>> rspec BROWSER=ie
>>>> rspec
>>>>
>>>> to me this makes more sense because , sorry if the code doesn't
>>>> actually work did this from memory
>>>>
>>>>
>>>> On Fri, Sep 20, 2013 at 9:08 AM, Dan <[email protected]> wrote:
>>>>
>>>>> Not sure what you're considering a failure, but you'll want to use
>>>>> some exception handling in that case.  See below for an example.  :none is
>>>>> not a valid browser so, it'll fail to initialize it, but keep going with
>>>>> some exception handling.
>>>>>
>>>>> require 'watir-webdriver'
>>>>> browsers = [:none,:firefox,:chrome,:**safari].each do |br|
>>>>> begin
>>>>> b = Watir::Browser.new br
>>>>> b.goto("google.com")
>>>>> puts b.title
>>>>> b.close
>>>>> rescue => e
>>>>> puts e.message
>>>>> next
>>>>> end
>>>>> end
>>>>>
>>>>> On Thursday, September 19, 2013 6:47:54 PM UTC-4, Ankita@Adslot wrote:
>>>>>>
>>>>>> Hi Dan
>>>>>>
>>>>>> Thanks for your reply. This does work if the script runs without any
>>>>>> failure, but, in case any failure happens script stops and does not 
>>>>>> execute
>>>>>> on other browsers.
>>>>>>
>>>>>>  I wanted something where even if script fails on one browser, it
>>>>>> still runs on others to complete the test.
>>>>>>
>>>>>> Your help is much appreciated!
>>>>>>
>>>>>> On Thursday, September 19, 2013 11:07:48 PM UTC+10, Dan wrote:
>>>>>>>
>>>>>>> Not sure what framework you're using or whatever, but you can do
>>>>>>> this pretty easy with a loop.  Below is the basic concept.
>>>>>>>
>>>>>>> require 'watir-webdriver'
>>>>>>> browsers = [:firefox,:chrome,:safari].**eac**h do |br|
>>>>>>> b = Watir::Browser.new br
>>>>>>> b.goto("google.com")
>>>>>>> puts b.title
>>>>>>> b.close
>>>>>>> end
>>>>>>>
>>>>>>> On Wednesday, September 18, 2013 11:57:44 PM UTC-4, Ankita@Adslotwrote:
>>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> Just wondering if there is a way I could automate my script to run
>>>>>>>> on three different browsers one after another...
>>>>>>>>
>>>>>>>> wanted something like
>>>>>>>>
>>>>>>>> Open Browser1 - firefox
>>>>>>>> Run script
>>>>>>>> Close Browser
>>>>>>>> <output>
>>>>>>>> Open Browser2 - ie
>>>>>>>> Run script
>>>>>>>> Close Browser
>>>>>>>> <output>
>>>>>>>> OpenBrowser3- phantomjs
>>>>>>>> Run script
>>>>>>>> Close Browser
>>>>>>>>  <output>
>>>>>>>>
>>>>>>>>
>>>>>>>> I know we could initiate browser of our choice through command
>>>>>>>> prompt and then run the script but just wondering if there is something
>>>>>>>> which could automate the process rather then running the test manually 
>>>>>>>> 3
>>>>>>>> times with three different browsers?
>>>>>>>>
>>>>>>>  --
>>>>> --
>>>>> Before posting, please read http://watir.com/support. In short:
>>>>> search before you ask, be nice.
>>>>>
>>>>> [email protected]
>>>>> http://groups.google.com/**group/watir-general<http://groups.google.com/group/watir-general>
>>>>> watir-genera...@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-genera...@googlegroups.**com.
>>>>>
>>>>> For more options, visit 
>>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>>> .
>>>>>
>>>>
>>>>  --
>>>> --
>>>> Before posting, please read http://watir.com/support. In short: search
>>>> before you ask, be nice.
>>>>
>>>> [email protected]
>>>> http://groups.google.com/**group/watir-general<http://groups.google.com/group/watir-general>
>>>> watir-genera...@googlegroups.**com
>>>>
>>>> ---
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Watir General" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/**
>>>> topic/watir-general/**C9ufcIGfIPY/unsubscribe<https://groups.google.com/d/topic/watir-general/C9ufcIGfIPY/unsubscribe>
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> watir-genera...@googlegroups.**com.
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>
>>>  --
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> [email protected]
> http://groups.google.com/group/watir-general
> [email protected]
>
> ---
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Mihir Dhandhusaria
516-776-6534

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

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to