[wtr-general] Re: Watir + win32/screenshot = screen shots when script ends/fails?

2012-11-10 Thread LongRed
Those two are not working for me "undefined local variable or method `browser' for # (Name Error)" Whereas "Win32::Screenshot::Take.of(:window, :title => /Windows Internet Explorer/).write(screenshot)" works like a charm. Regards, RL On Wednesday, March 28, 2012 10:58:35 PM UTC+2, Jarmo P

[wtr-general] Re: Watir + win32/screenshot = screen shots when script ends/fails?

2012-03-28 Thread Ry
Thanks for the tip Jarmo, Any reason you can think of to why I am unable to run the screenshot function with test_unit_loader.rb I have it set up like this gem 'test-unit' require 'test/unit' require 'ci/reporter/rake/test_unit_loader.rb' require 'watir' class ASPEC01_log < Test::Unit::TestCa

[wtr-general] Re: Watir + win32/screenshot = screen shots when script ends/fails?

2012-03-28 Thread Jarmo Pertman
Use window handle instead of title if possible: Win32::Screenshot::Take.of(:window, :hwnd => browser.hwnd).write(screenshot) Or if you're using some newer Watir, then use :rautomation attribute instead: Win32::Screenshot::Take.of(:rautomation, browser.rautomation).write(screenshot) Jarmo On Mar

[wtr-general] Re: Watir + win32/screenshot = screen shots when script ends/fails?

2012-03-27 Thread enroxorz
No worries, any time :) On Tuesday, March 27, 2012 4:23:33 PM UTC-4, Ry wrote: > > that worked perfectly! Thank you ever so much! > > On Tuesday, March 27, 2012 9:23:21 AM UTC-7, Ry wrote: >> >> Wondering if possible to snap shot the last screen / event my script was >> on when it finds an error

[wtr-general] Re: Watir + win32/screenshot = screen shots when script ends/fails?

2012-03-27 Thread Ry
that worked perfectly! Thank you ever so much! On Tuesday, March 27, 2012 9:23:21 AM UTC-7, Ry wrote: > > Wondering if possible to snap shot the last screen / event my script was > on when it finds an error / ends. I am using logging as well, but my > employer is requesting screen shots to go ha

[wtr-general] Re: Watir + win32/screenshot = screen shots when script ends/fails?

2012-03-27 Thread enroxorz
Worry, missed that last part. For pure watir (not including Test::Unit) begin [watir script] rescue screenshot = "/FAILED_#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}.png" Win32::Screenshot::Take.of(:window, :title => /Windows Internet Explorer/).write(screenshot) end Does that help? On Tues

[wtr-general] Re: Watir + win32/screenshot = screen shots when script ends/fails?

2012-03-27 Thread enroxorz
After do |scenario| if scenario.failed? @browser.maximize screenshot = "/FAILED_#{scenario.name.gsub(' ','_').gsub(/[^0-9A-Za-z_]/, '')}_#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}.png" Win32::Screenshot::Take.of(:window, :title => /Windows Internet Explorer/).write(screenshot) embed screen