Created
February 20, 2013 18:06
-
-
Save jontonsoup/4997600 to your computer and use it in GitHub Desktop.
This file contains 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 '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