Skip to content

Instantly share code, notes, and snippets.

@andreastt
Created April 26, 2011 14:19
Show Gist options
  • Save andreastt/942332 to your computer and use it in GitHub Desktop.
Save andreastt/942332 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'operawatir'
browser = OperaWatir::Browser.new
browser.goto 'http://maps.google.com/?hl=en'
puts 'Find the search box'
search = browser.text_field(:id, 'q_d')
puts 'Type text and submit the form'
search.set 'Opera Software ASA, Oslo to Den Norske Opera & Ballett'
browser.keys.send :enter
sleep 2
puts 'Select the first result'
browser.link(:id => 'ddw_dll_1_0').click
sleep 2
puts 'Pan down'
browser.div(:css, 'div[log="pan_down"]').click
puts 'Zoom in'
zoom_in = browser.div(:css, 'div[title="Zoom In"]')
2.times { zoom_in.click(10,10) }
puts 'Done'
sleep 10
browser.quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment