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].each 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@Adslot wrote:
>
> 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
[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.