Library version: | 1.0.0 |
---|---|
Library scope: | global |
Named arguments: | supported |
This test library provides some keywords to allow opening, reading, writing, and saving Excel files from Robot Framework.
Before running tests
Prior to running tests, ExcelRobot must first be imported into your Robot test suite.
Example:
Library | ExcelRobot |
To setup some Excel configurations related to date format and number format, use these arguments
Excel Date Time format
Date Format | Default: yyyy-mm-dd |
Time Format | Default: HH:MM:SS AM/PM |
Date Time Format | Default: yyyy-mm-dd HH:MM |
For more information, check this article https://support.office.com/en-us/article/format-numbers-as-dates-or-times-418bd3fe-0577-47c8-8caa-b4d30c528309
Excel Number format
Decimal Separator | Default: . |
Thousand Separator | Default: , |
Precision | Default: 2 |
Excel Boolean format
Boolean Format | Default: Yes/No |
Example:
Library | ExcelRobot | date_format='dd/mm/yyyy'
Arguments | Documentation |
---|---|
date_format=yyyy-mm-dd, time_format=HH:MM:SS AM/PM, datetime_format=yyyy-mm-dd HH:MM, decimal_sep=., thousand_sep=,, precision=2, bool_format=Yes/No | Init Excel Keyword with some default configuration. Excel Date Time format https://support.office.com/en-us/article/format-numbers-as-dates-or-times-418bd3fe-0577-47c8-8caa-b4d30c528309 |
Keyword | Arguments | Documentation | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Check Cell Type | sheet_name, column, row, data_type | Checks the type of value that is within the cell of the sheet name selected. Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Create Sheet | sheet_name | Creates and appends new Excel worksheet using the new sheet name to the current workbook. Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Get Column Count | sheet_name | Returns the specific number of columns of the sheet name specified. Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Get Column Values | sheet_name, column, include_empty_cells=True | Returns the specific column values of the sheet name specified. Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Get Number Of Sheets | Returns the number of worksheets in the current workbook. Example:
| |||||||||||||||||||||||||||||||||||||||||
Get Row Count | sheet_name | Returns the specific number of rows of the sheet name specified. Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Get Row Values | sheet_name, row, include_empty_cells=True | Returns the specific row values of the sheet name specified. Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Get Sheet Names | Returns the names of all the worksheets in the current workbook. Example:
| |||||||||||||||||||||||||||||||||||||||||
Get Sheet Values | sheet_name, include_empty_cells=True | Returns the values from the sheet name specified. Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Get Workbook Values | include_empty_cells=True | Returns the values from each sheet of the current workbook. Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Open Excel | file_path | Opens the Excel file to read from the path provided in the file path parameter. Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Open Excel To Write | file_path, new_path=None, override=False | Opens the Excel file to write from the path provided in the file name parameter. In case New Path is given, new file will be created based on content of current file. Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Read Cell Data | sheet_name, column, row, data_type=None, use_format=True | Uses the column and row to return the data from that cell.
Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Read Cell Data By Name | sheet_name, cell_name, data_type=None, use_format=True | Uses the cell name to return the data from that cell.
Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Save Excel | Saves the Excel file that was opened to write before. Example:
| |||||||||||||||||||||||||||||||||||||||||
Write To Cell | sheet_name, column, row, value, data_type=None | Write data to cell by using the given sheet name and the given cell that defines by column and row. If Data Type is not provided, ExcelRobot will introspect data type from given value to define cell type Arguments:
Example:
| ||||||||||||||||||||||||||||||||||||||||
Write To Cell By Name | sheet_name, cell_name, value, data_type=None | Write data to cell by using the given sheet name and the given cell that defines by name. If Data Type is not provided, ExcelRobot will introspect data type from given value to define cell type Arguments:
Example:
|