Excel Interface Class
Contributed by: David Brown
Summary
This ruby class provides simple methods for reading and writing data records to and from Excel spreadsheets. This data can then be easily used to create data-driven Watir tests. This class hides the complexities of directly using ruby's win32ole library to interface with Excel.
Features
- Excel Data can be identified/located on any sheet using and either a "Range" (e.g. "A1:C20") or dynamically by searching for a specific text label above a data range
- Excel Data formated as rows of records or as columns of records can easily be read
- Data can be read in as an Array of Hashes (using headers as keys), a plain 2D Array, or a simple Hash of key-value pairs.
- If the excel data file is already open, this class will simply attach to the open workbook and read its data instead of trying to re-open the file.
- [6/22/07] Support adding and removing excel worksheets
- [6/22/07] Support for ordered hashes, and writing them back to an excel file.
- [6/25/07] Uploaded the RDOC documentation for the XLS class see XLS_doc.zip
- [7/11/07] Made all get methods more flexible in how the range is specified (they now accept a string representing a literal range,a Named Range in the workbook, or a text label above a contiguous range of cells with data). This allowed me to simplify/shorten method names and to remove Redundant methods.
- [7/11/07]Updated the RDOC. It is now included in the attached XLS.zip file.
Comments (3)
Sep 29, 2008
Alister Scott says:
Is this still relevant with Rasta now available?Is this still relevant with Rasta now available?
Sep 29, 2008
sufyit says:
I think it is still relevant. This library is not a test manager, just a tool f...I think it is still relevant. This library is not a test manager, just a tool for easily reading/writing data to/from excel without having to learn how to use win32ole or excel's object model.
Sep 29, 2008
Alister Scott says:
Thanks, I have moved it under Advanced Examples.Thanks, I have moved it under Advanced Examples.