[wtr-general] Re: firefox on mac not quitting
Filed under http://jira.seleniumhq.org/browse/WTR-272 Matthias On 3 Dez., 16:33, Bret Pettichord <[EMAIL PROTECTED]> wrote: > Matthias, > > Thanks for the details. Would you mind logging this -- and Richard's > workaround -- in Jira so that we can be sure to get it fixed? > > Bret > > Matthias Marschall wrote: > > Hi Bret, > > > thanks for investigating. Here are some scenarios on my box using irb: > > > A) firefox already running > > > irb(main):001:0> require 'rubygems' > > => true > > irb(main):002:0> require 'firewatir' > > => true > > irb(main):003:0> b = Watir::Browser.new > > TypeError: exception class/object expected > > from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ > > firefox.rb:1078:in `raise' > > from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ > > firefox.rb:1078:in `js_eval' > > from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ > > firefox.rb:195:in `get_window_number' > > from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ > > firefox.rb:162:in `initialize' > > from /usr/local/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir/ > > browser.rb:65:in `new' > > from /usr/local/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir/ > > browser.rb:65:in `new' > > from (irb):3 > > > firefox shows a popup box telling me that only one instance of firefox > > can run simultaneously. Ok, no problem. > > > B) firefox _not_ running > > > irb(main):004:0> b = Watir::Browser.new > > => # > [], @window_url="about:blank", @t=#> > > irb(main):005:0> b.close > > > The Browser.new call opens firefox as expected. > > The b.close call closes the newly opened firefox window but never > > returns on its own. > > If I close ff now manually, the b.close call returns showing: > > > => # > > > Hope this helps! Any ideas are appreciated! > > > Matthias > > > On 2 Dez., 17:27, Bret Pettichord <[EMAIL PROTECTED]> wrote: > > >> Short answer: no. > > >> Dave Hoover says this is browser.quit in SafariWatir. Similar is > >> IE.close_all. We need to figure out what to do to be consistent. > > >> Regardless, this problem should not be causing your scripts not to > >> return. Can you provide more information? Something else may be happening. > > >> Bret > > >> Matthias Marschall 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 -~--~~~~--~~--~--~---
[wtr-general] Re: firefox on mac not quitting
Matthias, Thanks for the details. Would you mind logging this -- and Richard's workaround -- in Jira so that we can be sure to get it fixed? Bret Matthias Marschall wrote: > Hi Bret, > > thanks for investigating. Here are some scenarios on my box using irb: > > A) firefox already running > > irb(main):001:0> require 'rubygems' > => true > irb(main):002:0> require 'firewatir' > => true > irb(main):003:0> b = Watir::Browser.new > TypeError: exception class/object expected > from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ > firefox.rb:1078:in `raise' > from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ > firefox.rb:1078:in `js_eval' > from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ > firefox.rb:195:in `get_window_number' > from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ > firefox.rb:162:in `initialize' > from /usr/local/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir/ > browser.rb:65:in `new' > from /usr/local/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir/ > browser.rb:65:in `new' > from (irb):3 > > firefox shows a popup box telling me that only one instance of firefox > can run simultaneously. Ok, no problem. > > B) firefox _not_ running > > irb(main):004:0> b = Watir::Browser.new > => # [], @window_url="about:blank", @t=#> > irb(main):005:0> b.close > > The Browser.new call opens firefox as expected. > The b.close call closes the newly opened firefox window but never > returns on its own. > If I close ff now manually, the b.close call returns showing: > > => # > > Hope this helps! Any ideas are appreciated! > > Matthias > > On 2 Dez., 17:27, Bret Pettichord <[EMAIL PROTECTED]> wrote: > >> Short answer: no. >> >> Dave Hoover says this is browser.quit in SafariWatir. Similar is >> IE.close_all. We need to figure out what to do to be consistent. >> >> Regardless, this problem should not be causing your scripts not to >> return. Can you provide more information? Something else may be happening. >> >> Bret >> >> Matthias Marschall 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 -~--~~~~--~~--~--~---
[wtr-general] Re: firefox on mac not quitting
Hi Bret, thanks for investigating. Here are some scenarios on my box using irb: A) firefox already running irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'firewatir' => true irb(main):003:0> b = Watir::Browser.new TypeError: exception class/object expected from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ firefox.rb:1078:in `raise' from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ firefox.rb:1078:in `js_eval' from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ firefox.rb:195:in `get_window_number' from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.2/lib/firewatir/ firefox.rb:162:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir/ browser.rb:65:in `new' from /usr/local/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir/ browser.rb:65:in `new' from (irb):3 firefox shows a popup box telling me that only one instance of firefox can run simultaneously. Ok, no problem. B) firefox _not_ running irb(main):004:0> b = Watir::Browser.new => #> irb(main):005:0> b.close The Browser.new call opens firefox as expected. The b.close call closes the newly opened firefox window but never returns on its own. If I close ff now manually, the b.close call returns showing: => # Hope this helps! Any ideas are appreciated! Matthias On 2 Dez., 17:27, Bret Pettichord <[EMAIL PROTECTED]> wrote: > Short answer: no. > > Dave Hoover says this is browser.quit in SafariWatir. Similar is > IE.close_all. We need to figure out what to do to be consistent. > > Regardless, this problem should not be causing your scripts not to > return. Can you provide more information? Something else may be happening. > > Bret > > Matthias Marschall 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 -~--~~~~--~~--~--~---
[wtr-general] Re: firefox on mac not quitting
Thanks, Richard, for your solution. I came up with a similar workaround: system("echo 'tell application \"Firefox\" to quit' | osascript -") But I would need a little more code around it to make sure it only runs when the tests are executed on a mac. Matthias On 2 Dez., 20:36, "Richard Lawrence" <[EMAIL PROTECTED]> wrote: > 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] > > 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 -~--~~~~--~~--~--~---
[wtr-general] Re: firefox on mac not quitting
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 -~--~~~~--~~--~--~---
[wtr-general] Re: firefox on mac not quitting
Short answer: no. Dave Hoover says this is browser.quit in SafariWatir. Similar is IE.close_all. We need to figure out what to do to be consistent. Regardless, this problem should not be causing your scripts not to return. Can you provide more information? Something else may be happening. Bret Matthias Marschall 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 -~--~~~~--~~--~--~---