I strongly suggest you install the roo gem. It suppports: OpenOffice, Excel and GoogleDOcs workbooks.
See: http://roo.rubyforge.org/ To install on Windows: gem install roo To install on OSX: sudo gem install roo I use it on Linux, OSX, and WInXP, Vista, Win7 and it saves a lot of work! Joe On Aug 19, 4:28 am, jp <[email protected]> wrote: > Hi, > Iam using openoffice org calc in my office i can't access the > testdata from that sheet1. > can anyone guide me.. > > This is my code: > > folder_path='D:\\watir-v1_4\ghrms.rb' > require 'watir' > require 'win32ole' > > require "test/unit" > include Watir > ie = Watir::IE.new > ie.goto("http://ghrms.csscorp.com") > > noArgs = [] > file_uri = "file:///D:/Test.ods" > > serviceManager =WIN32OLE.new("com.sun.star.ServiceManager") > coreReflection > =serviceManager.createInstance("com.sun.star.reflection.CoreReflection") > desktop = serviceManager.createInstance("com.sun.star.frame.Desktop") > spreadsheet =desktop.loadComponentFromURL(file_uri, "_blank", 0, > noArgs) > sheetsCollection = spreadsheet.Sheets > sheet1 = sheetsCollection.getByIndex(0) > > row =1 > > while row<=3 > > ie.text_field(:id,'username').value= > sheet1.getCellByPosition(0,0).Formula > sleep 2 > ie.text_field(:id,'password').value= > sheet1.getCellByPosition(0,1).Formula > sleep 2 > > ie.button(:name,"").click > ie.button(:value, "Login").click > row=row+1 > end > > I dnt know this coding is correct or not..when i run it in cmd prompt > > I get the erroe like unable to locate object,id and username.. > > ham new to watir... > i cant get the clear idea. > > Thanks in advance! -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
