Created
April 26, 2011 14:19
-
-
Save andreastt/942332 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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