Library version: | 1.1.0 |
---|---|
Library scope: | global |
Named arguments: | supported |
Library for working with Excel documents.
robot framework | http://robotframework.org |
Settings | Value |
Library | ExcelLibrary.py |
Library | Collections |
Test Cases | Action | Argument | Argument | Argument |
Simple | ||||
Create Excel Document | doc_id=docname1 | |||
Write Cell | row=1 | column=1 | value=text | |
Save | filename=file.xlsx | |||
Close Current Excel Document |
Keyword | Arguments | Documentation | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Close All Excel Documents | Closes all opened documents. Example:
| |||||||||||||||||||||||||||||||
Close Current Excel Document | Closes current document. Returns: Closed document identifier. Example:
| |||||||||||||||||||||||||||||||
Create Excel Document | doc_id | Creates new excel document. Args: doc_id: document identifier in the cache. Returns: Identifier of created document. Example:
| ||||||||||||||||||||||||||||||
Get List Sheet Names | Returns a list of sheet names in the current document. Returns: List of page names. Example:
| |||||||||||||||||||||||||||||||
Get Sheet | sheet_name=None | Returns a page from the current document. Args: sheet_name: sheet name. Returns: Document's sheet. | ||||||||||||||||||||||||||||||
Open Excel Document | filename, doc_id | Opens xlsx document file. Args: filename: document name. doc_id: the identifier for the document that will be opened. Returns: Document identifier from the cache. Example:
| ||||||||||||||||||||||||||||||
Read Excel Cell | row_num, col_num, sheet_name=None | Returns content of a cell. Args: row_num: row number, starts with 1. col_num: column number, starts with 1. sheet_name: sheet name, where placed cell, that need to be read. Returns: Content of the cell in the specified column and row. Example:
| ||||||||||||||||||||||||||||||
Read Excel Column | col_num, row_offset=0, max_num=0, sheet_name=None | Returns content of a column from the current sheet of the document. Args: col_num: column number, starts with 1. row_offset: indent. max_num: maximum number of columns to read. sheet_name: sheet name, where placed column, that need to be read. Returns: List, that stores the contents of a row. Example:
${cd}= | Read Excel Column | col_num=3 | max_num=3 | sheet_name=${DEFAULT_SHEET_NAME}| Lists Should Be Equal | ${col_data} | ${cd} | Close All Excel Documents | | ||||||||||||||||||||||||||||||
Read Excel Row | row_num, col_offset=0, max_num=0, sheet_name=None | Returns content of a row from the current sheet of the document. Args: row_num: row number, starts with 1. col_offset: indent. max_num: maximum number of rows to read. sheet_name: sheet name, where placed row, that need to be read. Returns: List, that stores the contents of a row. Example:
| ||||||||||||||||||||||||||||||
Save Excel Document | filename | Saves the current document to disk. Args: filename: file name to save. Example:
| ||||||||||||||||||||||||||||||
Switch Current Excel Document | doc_id | Switches current excel document. Args: doc_id: identifier of the document to switch. Returns: Identifier of previous document. Example:
| ||||||||||||||||||||||||||||||
Write Excel Cell | row_num, col_num, value, sheet_name=None | Writes value to the cell. Args: row_num: row number, starts with 1. col_num: column number, starts with 1. value: value for writing to a cell. sheet_name: sheet name for write. | ||||||||||||||||||||||||||||||
Write Excel Column | col_num, col_data, row_offset=0, sheet_name=None | Writes the data to a column. Args: col_num: column number, starts with 1. col_data: list of values for writing. row_offset: number of indent rows from start. sheet_name: sheet name for write. | ||||||||||||||||||||||||||||||
Write Excel Row | row_num, row_data, col_offset=0, sheet_name=None | Writes a row to the document. Args: row_num: row number, starts with 1. row_data: list of values for writing. col_offset: number of indent columns from start. sheet_name: sheet name for write. | ||||||||||||||||||||||||||||||
Write Excel Rows | rows_data, rows_offset=0, col_offset=0, sheet_name=None | Writes a list of rows to the document. Args: rows_data: list of rows for writing. col_offset: number of indent columns from start. rows_offset: number of indent rows from start. sheet_name: sheet name for write. |