I use appscript to quit Firefox like this: in browserfactory.rb --- require 'firewatir' require 'appscript'
class BrowserFactory def get_new_browser # close Firefox if it's running if Appscript.app('System Events').processes['Firefox'].exists() Appscript.app('Firefox').quit end FireWatir::Firefox.new(:profile => 'firewatir') end def quit_browser Appscript.app('Firefox').quit end end in some_cucumber_steps.rb, which requires browserfactory (implicitly, thanks to cucumber) --- Before do @browser_factory = BrowserFactory.new @b = @browser_factory.get_new_browser end After do @browser_factory.quit_browser end ... It would be nice if the APIs matched for the different flavors of Watir, but for my current app, I'm only testing with FF on Mac, so this works for me. Richard -- Richard Lawrence Certified Scrum Coach Founder and Principal Consultant, Humanizing Work, LLC 303-895-7688 [EMAIL PROTECTED] www.humanizingwork.com www.richardlawrence.info On Tue, Dec 2, 2008 at 8:20 AM, Matthias Marschall <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm using firewatir 1.6.2 on Mac OS 10.5.5 with firefox 3.0.4. > > browser = Watir::Browser.new > > opens firefox as expected. > > browser.close > > closes the window opened before, but does not quit firefox. > > Is there any way to make firewatir quit firefox? Currently, my watir > scripts never return as they seem to be waiting on firefox to exit. > Manually quitting firefox works but is a bad workaround. > > Any ideas? > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---