This is very simple with a CSV file:

require 'csv'

CSV::Reader.parse(File.open(ARGV[0], 'rb')) do |row| #open the filename
given as first command line argument
  userid = row[0] #note that the CSV module index starts at 0
  passwd = row[1]
  loginToSite(userid,passwd) #whatever your login code is
End

Cheers,
Ian

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Vipul
Sent: Friday, May 11, 2007 7:51 AM
To: [email protected]
Subject: [Wtr-general] Running test script once for each datarow in
excel

i am testing a site which has login page.

i want to automate login with different user credentials each time.

i want username and pwd values to come from excel sheet or input.rb
whichever possible.

Does anyone has the code or suggestion for implementing this.
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to