lib/watirsplash/html_formatter.rb in watirsplash-0.2.1 vs lib/watirsplash/html_formatter.rb in watirsplash-0.2.2
- old
+ new
@@ -66,11 +66,12 @@
$stderr.puts e.backtrace
end
file_name
end
- def save_screenshot(description="Screenshot", hwnd=@browser.hwnd) # :nodoc:
+ def save_screenshot(description="Screenshot", hwnd=nil) # :nodoc:
begin
+ hwnd ||= @browser.hwnd
@browser.bring_to_front
Win32::Screenshot.hwnd(hwnd) do |width, height, blob|
file_name = file_path("screenshot.png", description)
img = Magick::ImageList.new
img.from_blob(blob)
\ No newline at end of file