Skip to content

Instantly share code, notes, and snippets.

@jontonsoup
Created February 20, 2013 18:06
Show Gist options
  • Save jontonsoup/4997600 to your computer and use it in GitHub Desktop.
Save jontonsoup/4997600 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'watir-webdriver'
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 3000 # seconds – default is 60
b = Watir::Browser.new :firefox, :http_client => client
b.goto 'http://www.android-permissions.org/'
#put your directory here
entries = Dir.entries("/Users/Jonathan/Desktop/apps")
entries.each do |entry|
unless entry == "." || entry == ".." || entry == ".DS_Store"
b.goto("http://www.android-permissions.org/")
b.link(:class, "important").click
b.file_field(:id, "file").set("/Users/Jonathan/Desktop/apps/" + entry)
b.button(:name, "submit").click
text = b.div(:id, "outermost").text
puts entry + "\n"
puts text
puts "\n"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment