SeleniumLibrary
SeleniumLibrary is a web testing library for Robot Framework, leveraging the Selenium WebDriver internally. It supports robust browser automation for web application testing. The current version, 6.8.0, supports Python 3.8 through 3.14, various Selenium 4.x versions, and Robot Framework 6.1.1 through 7.3.2. Releases are frequent, typically adapting to new Python, Selenium, and Robot Framework versions.
Warnings
- breaking SeleniumLibrary version 6.0.0 and newer requires Selenium WebDriver 4.x+. Older versions of Selenium are no longer supported.
- deprecated The `headlesschrome` and `headlessfirefox` browser options for `Open Browser` were deprecated and removed in v6.2.0. Headless mode should now be configured using Selenium options directly.
- gotcha SeleniumLibrary v6.1.1 fixed an incompatibility with Selenium v4.10.0+ where certain deprecated Selenium code paths were removed, causing issues for the library.
- gotcha Version 6.7.1 downgraded the requirement on the `click` dependency to `click>=8.0` to address installation issues in some environments.
- breaking Python 2 support was dropped prior to SeleniumLibrary 4.0. All modern versions require Python 3.8+.
- breaking Prior to version 3.0, the library was known as `Selenium2Library`. Migrating to `SeleniumLibrary` requires changing the import statement (`Library Selenium2Library` to `Library SeleniumLibrary`) and potentially updating keyword calls if prefixed.
Install
-
pip install robotframework-seleniumlibrary
Imports
- SeleniumLibrary
*** Settings *** Library SeleniumLibrary
Quickstart
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
Example Login Test
Open Browser https://the-internet.herokuapp.com/login browser=chrome
Input Text id=username ${USERNAME_HERE}
Input Text id=password ${PASSWORD_HERE}
Click Button css:button[type='submit']
Element Should Contain id=flash You logged into a secure area!
Close Browser