Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Using watir-webdriver, take screenshots in Google Chrome of a responsive website running on a local python simple server at different breakpoints
# Katie Harron - @pibby
require 'watir-webdriver'
mq = [320,480,640,768,1024,1280,1440]
b = :chrome
b.goto 'http://localhost:8000'
mq.each do |i|
width = i
height = 5000
puts i
b.window.resize_to(width, height)
sleep 3 "screenshots/chrome-#{i}.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment