The code below was an interesting experiment, but not so straightforward. Don't try this at home :) (although it would be kind of cool to get it working, as side-by-side execution is something I would use).
Jared On Jan 6, 10:55 pm, Jared Quinert <[email protected]> wrote: > If it's just about running the same test code, I've documented an > approach here: > > http://www.software-testing.com.au/blog/2009/07/02/running-watir-cros... > > I found there were minor differences between browsers that I needed to fix. > > Or did you mean you wanted to run tests simultaneously against different > browsers to do a side-by-side comparison? > I can't test this as my PC at home isn't set up, but can someone confirm > if something like this should work? > > class Browsers > def initialize(browsers) > @browsers=[] > browsers.each do |browser | > @browsers.push Watir::IE.new if browser=='ie' > @browsers.push FireWatir::Firefox.new if browser=='firefox' > end > end > > def method_missing(method, *args) > @browsers.each do | browser | > browser.send(method, *args) > end > end > > end > > browsers=Browsers.new([ie, firefox]) > browsers.goto('http://www.google.com/') > > Jaredhttp://www.software-testing.com.au/blog/ > > > > tester86 wrote: > > Question, with the not tested code: > > > If I was to test against one application or browser i.e. google and > > then search in both IE and FF would I need to specify the code twice. > > > Could I state: > > > Open IE > > Open FF > > > Check Page Title > > Text Box Place "Test" > > Click Search > > > End > > > All of the above would be one set of code not duplicating the code > > twice.. > > > On Jan 5, 9:30 am, tester86 <[email protected]> wrote: > > >> Hi > > >> Or would you like to do something like this (not tested)? > > >>> [Watir::IE.new, FireWatir::Firefox.new].each do |browser| > >>> browser.goto "google.com" > >>> browser.goto "yahoo.com" > >>> end > > >>> The above code will go to google and yahoo first in IE, and then in FF > > >> --Yes I would like something like that. Has this been tested or is > >> there any good documentation? > > >> Thanks > > >> On Jan 5, 8:29 am, Željko Filipin <[email protected]> > >> wrote: > > >>> On Tue, Jan 5, 2010 at 3:21 PM, tester86 <[email protected]> wrote: > > >>>> My question is would I have to write two sets of code > >>>> one for ie and one for ff in order to run my script against both > >>>> browsers. > > >>> I am not sure what you mean by this. Would this work for you? > > >>> ie = Watir::IE.new > >>> ie.goto "google.com" > > >>> ff = FireWatir::Firefox.new > >>> ff.goto "google.com" > > >>> ie.goto "yahoo.com" > >>> ff.goto "yahoo.com > > >>> Or would you like to do something like this (not tested)? > > >>> [Watir::IE.new, FireWatir::Firefox.new].each do |browser| > >>> browser.goto "google.com" > >>> browser.goto "yahoo.com" > >>> end > > >>> The above code will go to google and yahoo first in IE, and then in FF. > > >>> Željko > >>> -- > >>> watir.com - community manager > >>> watirpodcast.com - host- Hide quoted text - > > >> - Show quoted text -- Hide quoted text - > > - Show quoted text -
-- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to [email protected] Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/watir-general
