Selenium2Library is a web testing library for Robot Framework that leverages the Selenium 2 (WebDriver) libraries from the Selenium project.
It is modeled after (and forked from) the SeleniumLibrary library, but re-implemented to use Selenium 2 and WebDriver technologies.
- More information about this library can be found on the Wiki and in the Keyword Documentation.
- Installation information is found in the INSTALL.rst file.
- Developer information is found in BUILD.rst file.
The recommended installation method is using pip:
pip install robotframework-selenium2library
The main benefit of using pip
is that it automatically installs all
dependencies needed by the library. Other nice features are easy upgrading
and support for un-installation:
pip install --upgrade robotframework-selenium2library pip uninstall robotframework-selenium2library
Notice that using --upgrade
above updates both the library and all
its dependencies to the latest version. If you want, you can also install
a specific version or upgrade only the Selenium tool used by the library:
pip install robotframework-selenium2library==1.4.1 pip install --upgrade selenium pip install selenium==2.34
If you are behind a proxy, you can use --proxy
command line option
or set http_proxy
and/or https_proxy
environment variables to
configure pip
to use it. If you are behind an authenticating NTLM proxy,
you may want to consider installing CNTML
to handle communicating with it.
For more information about --proxy
option and using pip with proxies
in general see:
- http://pip-installer.org/en/latest/usage.html
- http://stackoverflow.com/questions/9698557/how-to-use-pip-on-windows-behind-an-authenticating-proxy
- http://stackoverflow.com/questions/14149422/using-pip-behind-a-proxy
If you do not have network connection or cannot make proxy to work, you need to resort to manual installation. This requires installing both the library and its dependencies yourself.
Make sure you have Robot Framework installed.
Download source distributions (
*.tar.gz
) for the library and its dependencies:Extract each source distribution to a temporary location.
Go to each created directory from the command line and install each project using:
python setup.py install
If you are on Windows, and there are Windows installers available for certain projects, you can use them instead of source distributions. Just download 32bit or 64bit installer depending on your system, double-click it, and follow the instructions.
To write tests with Robot Framework and Selenium2Library, Selenium2Library must be imported into your Robot test suite. See Robot Framework User Guide for more information.
A demo project illustrating how to use this library can be found from: https://bitbucket.org/robotframework/webdemo
Please see the usage instructions from the demo project pages.
The user group for Robot Framework is the best place to get help. Consider including in the post:
- Full description of what you are trying to do and expected outcome
- Version number of Selenium2Library, Robot Framework, and Selenium
- Traceback or other debug output containing error information