Class: Watir::Screenshot
- Inherits:
-
Object
- Object
- Watir::Screenshot
- Defined in:
- lib/watir-webdriver/screenshot.rb
Instance Method Summary collapse
-
#base64 ⇒ String
Represents screenshot as Base64 encoded string.
-
#initialize(driver) ⇒ Screenshot
constructor
A new instance of Screenshot.
-
#png ⇒ String
Represents screenshot as PNG image string.
-
#save(path) ⇒ Object
Saves screenshot to given path.
Constructor Details
#initialize(driver) ⇒ Screenshot
Returns a new instance of Screenshot.
4 5 6 |
# File 'lib/watir-webdriver/screenshot.rb', line 4 def initialize(driver) @driver = driver end |
Instance Method Details
#base64 ⇒ String
Represents screenshot as Base64 encoded string.
45 46 47 |
# File 'lib/watir-webdriver/screenshot.rb', line 45 def base64 @driver.screenshot_as(:base64) end |
#png ⇒ String
Represents screenshot as PNG image string.
31 32 33 |
# File 'lib/watir-webdriver/screenshot.rb', line 31 def png @driver.screenshot_as(:png) end |
#save(path) ⇒ Object
Saves screenshot to given path.
17 18 19 |
# File 'lib/watir-webdriver/screenshot.rb', line 17 def save(path) @driver.save_screenshot(path) end |