Robotframework-excellibrary is a Robot Framework Library that provides keywords to allow opening, reading, writing and saving Excel files (xls). The robotframework-excellibrary leverages two other python libraries xlutils and natsort. Xlutils installs xlrd that reads data from an Excel file and xlwt write to an Excel file.
- Information about robotframework-excellibrary keywords can be found on the ExcelLibrary-Keyword Documentation page.
- Information about working with Excel files in Python can be found on the Python Excel page.
- Useful pdf for practical use with Excel files here.
- Python 3.7.x (Newer versions not tested)
The recommended installation tool is pip.
Install pip. Enter the following:
pip install robotframework-excellibrary
Append --upgrade
to update both the library and all
its dependencies to the latest version:
pip install --upgrade robotframework-excellibrary
To install a specific version enter:
pip install robotframework-excellibrary==(DesiredVersion)
To install robotframework-excellibrary manually, install all dependency libraries before installing robotframework-excellibrary.
Download source distributions (
*.tar.gz
) from here.Open command line:
pip install <tar.gz path>
To uninstall robotframework-excellibrary use the following pip command:
pip uninstall robotframework-excellibrary
- ExcelLibrary/ExcelLibrary.py :
- The Robot Python Library that makes use of the xlutils and natsort.
- Tests/acceptance/ExcelRobotTest.robot :
- Example test file to display what various keywords from robotframework-excellibrary accomplish
- doc/ExcelLibrary-KeywordDocumentation.html :
- Keyword documentation for the robotframework-excellibrary.
To write tests with Robot Framework and robotframework-excellibrary, ExcelLibrary must be imported into your Robot test suite. See doc/ExcelLibrary-KeywordDocumentation.html for more information.
The test file ExcelRobotTest.robot
, is an easily executable test for Robot Framework using robotframework-excellibrary.
For in depth detail on how the keywords function, read the Keyword documentation.
To run the test, open a command prompt within the Tests/acceptance folder and run:
robot ExcelRobotTest.robot
- When using the keyword Add New Sheet the user cannot perform any functions before or after this keyword on the currently open workbook. The changes that other keywords make will not be saved when the keyword Add New Sheet is used. They must add a sheet then save the workbook before using any other keyword. If they want to use any other keywords on the workbbok they must open the workbook again to do so.
- We cannot use xlsx files as this has not been implemented in the xlrd library. To get round this issue, consider using robotframework-excellib.
The user group for Robot Framework is the best place to get help. Include in the post:
- Contact the Python-Excel google group
- Full description of what you are trying to do and expected outcome
- Version number of robotframework-excellibrary and Robot Framework
- Traceback or other debug output containing error information