def take_screenshot(to_file = nil, opts = {})
        # puts "calling new take screenshot: #{$screenshot_supported}"
        # unless $screenshot_supported
        #   puts " [WARN] Screenhost not supported, check whether win32screenshot gem is installed" 
        #   return
        # end

        if to_file
          screenshot_image_filepath = to_file
        else
          screenshot_image_filename =  "screenshot_" + Time.now.strftime("%m%d%H%M%S") + ".jpg"
          the_dump_dir = opts[:to_dir] || default_dump_dir
          FileUtils.mkdir_p(the_dump_dir) unless File.exists?(the_dump_dir)
          screenshot_image_filepath = File.join(the_dump_dir, screenshot_image_filename)
          screenshot_image_filepath.gsub!("/", "\\") if is_windows?

          FileUtils.rm_f(screenshot_image_filepath) if File.exist?(screenshot_image_filepath)
        end

          # save screenshot with selenium
          @web_browser.driver.save_screenshot(screenshot_image_filepath)
          notify_screenshot_location(screenshot_image_filepath)

      end
def take_screenshot(to_file = nil, opts = {})
        # puts "calling new take screenshot: #{$screenshot_supported}"
        # unless $screenshot_supported
        #   puts " [WARN] Screenhost not supported, check whether win32screenshot gem is installed" 
        #   return
        # end

        if to_file
          screenshot_image_filepath = to_file
        else
          screenshot_image_filename =  "screenshot_" + Time.now.strftime("%m%d%H%M%S") + ".jpg"
          the_dump_dir = opts[:to_dir] || default_dump_dir
          FileUtils.mkdir_p(the_dump_dir) unless File.exists?(the_dump_dir)
          screenshot_image_filepath = File.join(the_dump_dir, screenshot_image_filename)
          screenshot_image_filepath.gsub!("/", "\\") if is_windows?

          FileUtils.rm_f(screenshot_image_filepath) if File.exist?(screenshot_image_filepath)
        end

          # save screenshot with selenium
          @web_browser.driver.save_screenshot(screenshot_image_filepath)
          notify_screenshot_location(screenshot_image_filepath)

      end
TODO: Common driver module =>  this is shared by both Watir and Selenium

 use win32screenshot library or Selenium to save curernt active window

 opts[:to_dir] => the direcotry to save image under