cielavenir

selenium test

Dec 1st, 2012
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.65 KB | None | 0 0
  1. #!/usr/bin/ruby
  2. #coding:utf-8
  3. #Download selenium driver from https://code.google.com/p/chromedriver/downloads/list
  4. require 'selenium-webdriver'
  5. Selenium::WebDriver::Chrome.path = '/usr/bin/chromium' #Chrome path. You might want to set Iron instead?
  6. userdir = '/home/USER/Desktop/selenium'
  7. driver = Selenium::WebDriver.for :chrome ,:switches => %W[--enable-easy-off-store-extension-install --allow-running-insecure-content --user-data-dir=#{userdir}]
  8. exit if ARGV[0]=='setup' #Chrome window doesn't close. Install cTouch and login to mbga/gree.
  9.  
  10. #start macro.
  11. 3.times{|i|
  12.     driver.navigate.to 'http://gree.jp/'
  13.     sleep 2
  14. }
  15. driver.quit #close Chrome window.
Advertisement
Add Comment
Please, Sign In to add comment