Hi,
I am completely new to WATIR, and don't have much programming experience so
forgive the simplicity of this question!
I am just learning the basics and have created a script that calls an excel
file which has a column of web addresses. I have got the scripts to read in the
first value from A1 and when executed, the script goes to that web address.
My question is how do I set the script up to loop round reading in all the web
addresses in the column, so it goes to each web address in turn and then finish
when it gets to an empty line.
My script looks like this at the minute:
require 'win32ole'
excel = WIN32OLE::new('excel.Application')
workbook = excel.Workbooks.Open('C:\Documents and Settings\kennedyn\My
Documents\WATIR_RUBY\excel_testdata.xls')
worksheet = workbook.Worksheets(1) #get hold of the first worksheet
worksheet.Select #bring it to the front -need sometimes to run macros, not for
working with a worksheet from ruby
excel['Visible'] = false #make visible, set to false to make invisible again.
Don't need it to be visible for script to work
excel = WIN32OLE::new('excel.Application')
workbook = excel.Workbooks.Open('C:\Documents and
Settings\excel_testdata.xls')
worksheet = workbook.Worksheets(1) #get hold of the first worksheet
worksheet.Select
$data = worksheet.Range('a1')['text'] # The data is in cell a1.
excel['Visible'] = false # hide the spreadsheet from view
workbook.close
excel.Quit
# Insert the data read from the spreadsheet into the text field
#$ie.text_field(:name, 'TEST').set $data
ie.goto('http://' + $data)
TIA
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general