In this tutorial I’ll show how to use the Selenium webdriver with Chrome and Ruby code to execute automated website tests and take screenshots along the way.
Now you’re ready to write some ruby code. I created a new file “test.rb”:
Made the file executable, and executed it:
A screenshot was created in the working directory.
Notice how the google screenshot was from an unauthenticated user? Here’s another script that authenticates first, hits a list of urls, and takes a screenshot of each page: