Ruby WATIR easy browser automation

I needed to run 100 accounts through on 6 different URLs and record end user response times. In less than 30 lines of code Ruby WATIR did the job for me.

require 'thread'
require 'watir'

url     = ARGV[0]
acc_in     = ARGV[1]
log_out = ARGV[2]

def Login(url, ie)
ie.goto(url)
ie.text_field(:name,'txtUsername').set 'nicks'
ie.text_field(:id,'txtPassword').set 'xxxxxxxx'
ie.button(:id,'btnLogon').click
end

def search_account(accnum, ie, log_out)
ie.frame(:id, 'iFMain').text_field(:id,'txtAccNumber').set accnum
start = Time.now
ie.frame(:id, 'iFMain').button(:id,'btnDisplay').click
diff = Time.now - start
File.open(log_out, 'a') do |f2|
f2.puts "#{start} , #{diff},  #{accnum.strip} "
end
return
end

ie = Watir::Browser.new
Login(url, ie)

IO.foreach(acc_in) do |line|
search_account(line, ie, log_out)
end