Taking screenshots in Selenium with Ruby

Find the below that can be used to take screenshots in Selenium when you writing your Automated code in Ruby

 

require 'rubygems'
require 'selenium-webdriver'

driver = Selenium::WebDriver.for :ie 
driver.get "https://www.google.com"   

//This can be further modified and you can have save it in location of your choice.
driver.save_screenshot("./screen.png")

 

You may also like...