lib/gatling/capture_element.rb in gatling-1.0.3 vs lib/gatling/capture_element.rb in gatling-1.0.4
- old
+ new
@@ -1,6 +1,6 @@
-module Gatling
+module Gatling
class CaptureElement
def initialize element_to_capture
@reference_image_path = Gatling::Configuration.reference_image_path
@element = element_to_capture
@@ -15,10 +15,11 @@
puts "Could not create directory #{temp_dir}. Please make sure you have permission"
end
#captures the uncropped full screen
begin
- page.driver.browser.save_screenshot("#{temp_dir}/temp.png")
+
+ Capybara.page.driver.browser.save_screenshot("#{temp_dir}/temp.png")
temp_screenshot = Magick::Image.read("#{temp_dir}/temp.png").first
rescue
raise "Could not save screenshot to #{temp_dir}. Please make sure you have permission"
end
end
\ No newline at end of file