SeleniumLibrary is a web testing library for Robot Framework that utilizes the Selenium tool internally. SeleniumLibrary 3.0.0rc2 is a new release with with Python 3 support and and rewritten architecture. There are two bug fixes compared to the rc1.
- #1001 fixes problem when using library public API.
- #998 fixes problem with Selenium 3.6.0 and 3.7.0 when using Firefox
All issues targeted for SeleniumLibrary v3.0.0 can be found from the issue tracker.
If you have pip installed, just run
pip install --pre --upgrade robotframework-seleniumlibrary
to install the latest available release or use
pip install robotframework-seleniumlibrary==3.0.0rc2
to install exactly this version. Alternatively you can download the source distribution from PyPI and install it manually.
SeleniumLibrary 3.0.0rc2 was released on Tuesday November 28, 2017.
- Most important enhancements
- Python 3 support (#479, alpha 1)
- Change library name from Selenium2Library to SeleniumLibrary (#777, alpha 1)
- Can not call methods which uses @keyword decorated methods to change the keyword name from the library instance when extending library (#1001, rc 2)
- Element Should Be Focused keyword should use driver.switch_to.active_element also with Firefox (#998, rc 2)
- Create better architecture for Selenium2Library (#771, alpha 1)
- Enhance project documentation in README (#873, beta 1)
- Document that Jython and PyPy are supported but IronPython is not (#879, beta 3)
- Externally useful attributes should be declared public and documented. (#882, rc 1)
- New
strategy:value
syntax to specify locator strategy in addition to currentstrategy=value
(#908, beta 3) - Tables should be located using same logic as other elements (#923, beta 3)
- Cleanup and enhance keyword documentation (#925, rc 1)
- Clean up keywords related to alerts (#933, rc 1)
- Backwards incompatible changes
- Return value of
Register keyword to run on failure
cannot always be used to restore original state (#176, beta 3) - Capture Page Screenshot should not overwrite if file already exist (#502, alpha 1)
- Update required Robot Framework version to 2.8 (#703, alpha 1)
- Increase the required selenium version to latest selenium 2 version (#704, alpha 1)
- Use booleans arguments like in Robot Framework (#719, alpha 1)
- Modify Get WebElements not to raise exception when no elements are found (#805, beta 3)
- Remove SeleniumLibrary profile for Firefox (#883, beta 3)
- Cleaning up locating windows (#966, rc 1)
Get Selected List Values/Labels
keywords should not fail if list has no selections (#977, rc 1)- Remove unused expiry argument from
Add Cookie
keyword (#847, alpha 1) - Some checkbox keywords work also with radio buttons (#962, rc 1)
Set Screenshot Directory
is inconsistent with otherSet ...
keywords (#985, rc 1)Wait Until Element Is Enabled
should also checkreadonly
status (#958, rc 1)- Make it an error to unregister a locator strategy that hasn't been registered (#961, rc 1)
- Deprecate
Select From List
andUnselect From List
(#988, rc 1) - Enhancements to getting and validating elements counts (#949, rc 1)
- Return value of
- Acknowledgements
- Full list of fixes and enhancements
Python 3 support (#479, alpha 1)
The SeleniunLibrary was was enhanced to support Python 3.3 or newer. More precisely, the currently supported Python versions are 2.7, 3.3 and newer. Installation on Python 3 works exactly as it does for Python 2, and the recommended installation method is with pip.
To ease support for Python 3.3, the support for Python 2.6 was dropped (#620, alpha 1).
Change library name from Selenium2Library to SeleniumLibrary (#777, alpha 1)
Because Selenium moved from version 2 to version 3, we felt that the old name, Selenium2Library, did not anymore describe what the library supports and helps user to achieve. Therefore we renamed the original SeleniumLibrary to OldSeleniumLibrary. Then the Selenium2Libary was renamed to SeleniumLibrary and new Selenium2Library was created. The new Selenium2Library is just a wrapper for the SeleniumLibrary and is meant only to ease migration from Selenium2Library to SeleniumLibrary.
Can not call methods which uses @keyword decorated methods to change the keyword name from the library instance when extending library (#1001, rc 2)
When doing this:
from SeleniumLibrary import SeleniumLibrary lib = SeleniumLibrary() print lib.keywords.get('get_webelements')
the print should not display False, instead it should display the library keyword method.
Element Should Be Focused keyword should use driver.switch_to.active_element also with Firefox (#998, rc 2)
With selenium 3.6.0 (or smaller) and when using Firefox (with geckodriver) the driver.switch_to.active_element returns a dictionary which contains the a WebElement. Starting from Selenium 3.7.0 this is fixed and driver.switch_to.active_element returns directly a WebElement.
Make SeleniumLibrary to use driver.switch_to.active_element with Firefox and support Selenium 3.6.0 and 3.7.0.
Create better architecture for Selenium2Library (#771, alpha 1)
The old architecture did contained many practices which are against good coding practices and made the development of the library slower or more difficult. The old architecture made also hard to define clear API interface for the user who are building their own libraries on top of the SeleniumLibrary.
The new architecture relies on the Robot Framework Dynamic library API, PythonLibCore and using context object to share common methods between different classes and methods. Because of the new architecture, many private methods or classes have been changed or removed totally.
The new architecture should not change how the keywords are used in Robot Framework test data. But new architecture causes changes how the SeleniumLibrary can be used to build new libraries. We have deprecated many private methods and have created many new public methods or attributes which should make the extending more easier in the future.
Enhance project documentation in README (#873, beta 1)
The project documentation, expect keyword documentation, has been rewritten to better serve user of the SeleniumLibrary. Also documentation was enhanced in: (#924, beta 3)
Document that Jython and PyPy are supported but IronPython is not (#879, beta 3)
The current release was automatically tested with Python 2.7, Python 3.3 and Python 3.6. The Jython, PyPy and IronPython compatibility was tested manually. We found that SeleniumLibrary supports Jython and PyPy, but IronPython is not supported.
Next steps are add the Jython and PyPy testing in CI.
Externally useful attributes should be declared public and documented. (#882, rc 1)
The library public API was enhanced. The public API contains methods to find single element or find multiple element. The browser attribute was renamed to driver and BrowserCache was renamed to WebDriverCache. Also some of the internal methods where renamed from browser to driver. Also sphinx style definitions where added to most used methods to ease IDE support. The change is not visible in the keyword level.
New strategy:value
syntax to specify locator strategy in addition to current strategy=value
(#908, beta 3)
New strategy:value
syntax to specify locator strategy in addition to
current strategy=value
. The current locator strategy causes problems with
Robot Framework keyword argument syntax, because then the equal sing must
be escaped, example xpath\=//div | &{kw_args} |
. The locator syntax is
aimed to ease the transition when the keyword arguments are in future taken
in use.
Tables should be located using same logic as other elements (#923, beta 3)
In the previous releases, the table keywords locator strategy did differ greatly from the rest of keywords which did interact with elements in the browsers. This is now changed and tables can be located with same locator strategies which can be used for the rest of the library.
Cleanup and enhance keyword documentation (#925, rc 1)
Whole keyword documentation has been rewritten and formatted to use the Robot Framework library documentation format. The new documentation should describe better what the keywords are actually doing and make the keyword usage more easier.
Clean up keywords related to alerts (#933, rc 1)
The logic of alert related keywords has been rewritten. The alert keywords logic, in previous releases was not clean and contained many obvious bugs. Because of this many of the alert keywords has been deprecated and new keywords have been created to provide better interface for handling alters. See the keyword documentation and the issue for details about the change.
Return value of Register keyword to run on failure
cannot always be used to restore original state (#176, beta 3)
In this release the keyword returned by the Register keyword to run on
failure
keyword can be always used to restore the original state. User
do not anymore need to have special logic in Robot Framework test data
to restore the Run On Failure
keyword.
Capture Page Screenshot should not overwrite if file already exist (#502, alpha 1)
The Capture Page Screenshot
keyword now verifies from the file system
that screenshot file does not exist in the file system. If the file
exist, it will create new index in the file name until it find a file
name which does not exist.
If the filename does not contain index, the filename is always overwritten.
Update required Robot Framework version to 2.8 (#703, alpha 1)
The minimum requires Robot Framework version is now updated to 2.8.7.
In next release, it is planned to drop the support for Robot Framework 2.8.7.
Increase the required selenium version to latest selenium 2 version (#704, alpha 1)
The minimum required Selenium version is now updated to 2.53.6, which is the latest Selenium 2 release. The resent versions of Selenium 3 are also supported.
Use booleans arguments like in Robot Framework (#719, alpha 1)
The boolean arguments are handled in similar way as in Robot Framework. More details in library Boolean arguments documentation.
Modify Get WebElements not to raise exception when no elements are found (#805, beta 3)
The Get WebElements keyword does not anymore fail if the keyword does not find any elements.
Remove SeleniumLibrary profile for Firefox (#883, beta 3)
The Firefox profile was removed from the SeleniumLibrary and Selenium default profile is used instead. Although this should not cause any problems, there is low risk for some backwards incompatible change.
Cleaning up locating windows (#966, rc 1)
Like alter in keywords, the logic of selecting windows did contains inconsistency. This logic has been now refactored to be consistent and some of the supported ways to selecting window has been dropped. But now the documentation how the window can be located is enhanced and it should be clear how locating windows works.
Get Selected List Values/Labels
keywords should not fail if list has no selections (#977, rc 1)
The Get Selected List Values/Labels keywords do not anymore fail if the list has not no selections. This change was done to unify how the Get* type of keywords works.
Remove unused expiry argument from Add Cookie
keyword (#847, alpha 1)
The expiry argument was removed in alpha 1 because it was not used. But the expiry argument was added back in the (#891, rc 1)
Some checkbox keywords work also with radio buttons (#962, rc 1)
Some of the checkbox keywords did work also with radio buttons in previous released. This is changed in this release and checkbox keywords only work with radio buttons.
Set Screenshot Directory
is inconsistent with other Set ...
keywords (#985, rc 1)
The other Set type of keywords replace the previous value but the Set Screenshot Directory
keyword tries to restore the previous value when the scope end. Restoring the previous value
is good idea, but it did have a bug and it was poorly documented. Automatically restoring the
original value might be a good feature, but it should be used consistently, be documented better,
and obviously also fixed. All that is way too much work in release 3.0.0 and instead we'll remove
this functionality from
Wait Until Element Is Enabled
should also check readonly
status (#958, rc 1)
The Wait Until Element Is Enabled
now also checks the element readonly
status.
Make it an error to unregister a locator strategy that hasn't been registered (#961, rc 1)
Now an exception is raised if Unregister
keyword is used to unregister a locator strategy
which was not registered.
Deprecate Select From List
and Unselect From List
(#988, rc 1)
Select From List
and Unselect From List
keywords try to select/unselect items both by values
and labels. This makes their implementation complex and slow, and the code also seems to have
some subtle bugs.
In addition to these keywords, we have dedicated keywords (Un)select From List By Label
,
(Un)select From List By Value
and (Un)select From List By Index
which are much more simple.
We've decided to deprecate Select From List and Unselect From List keywords in favor of these
label/value/index specific keywords.
Enhancements to getting and validating elements counts (#949, rc 1)
In the previous releases the where different ways to count or verify how many elements
the page did contain: Locator Should Match X Times
, Xpath Should Match X Times
and
Get Matching Xpath Count
. Those keywords are now silently deprecated and user should now
use Page Should Contain Element
keyword with limit argument or the Get Matching Locator Count
keyword.
Many thanks to "thaffenden" to add Get Locations
keyword. "davidshepherd7" to fixing issue
when getting window information and switching windows on browsers that do not support javascript.
Many thanks to "wappowers" who added 'Get Cookie' keyword and added 'expiry' as value that can be set with 'Add Cookie' keyword.
Many thanks to many other contributors who have helped to make this release.
ID | Type | Priority | Summary | Added |
---|---|---|---|---|
#479 | enhancement | critical | Python 3 support | alpha 1 |
#777 | enhancement | critical | Change library name from Selenium2Library to SeleniumLibrary | alpha 1 |
#1001 | bug | high | Can not call methods which uses @keyword decorated methods to change the keyword name from the library instance when extending library | rc 2 |
#998 | bug | high | Element Should Be Focused keyword should use driver.switch_to.active_element also with Firefox | rc 2 |
#620 | enhancement | high | Drop Python 2.6 support | alpha 1 |
#771 | enhancement | high | Create better architecture for Selenium2Library | alpha 1 |
#873 | enhancement | high | Enhance project documentation in README | beta 1 |
#879 | enhancement | high | Document that Jython and PyPy are supported but IronPython is not | beta 3 |
#882 | enhancement | high | Externally useful attributes should be declared public and documented. | rc 1 |
#908 | enhancement | high | New strategy:value syntax to specify locator strategy in addition to current strategy=value |
beta 3 |
#923 | enhancement | high | Tables should be located using same logic as other elements | beta 3 |
#924 | enhancement | high | Enhance general library documentation in keyword docs | beta 3 |
#925 | enhancement | high | Cleanup and enhance keyword documentation | rc 1 |
#933 | enhancement | high | Clean up keywords related to alerts | rc 1 |
#176 | bug | medium | Return value of Register keyword to run on failure cannot always be used to restore original state |
beta 3 |
#435 | bug | medium | Note version added to recently added keywords. | beta 2 |
#546 | bug | medium | HTML5 specialized text fields not recognized as text fields | alpha 1 |
#652 | bug | medium | Handling alerts sometimes fails with Chrome | alpha 1 |
#779 | bug | medium | Acceptance test do not work in windows | alpha 1 |
#790 | bug | medium | Cannot switch windows on browsers which don't support javascript | alpha 1 |
#816 | bug | medium | Modify Capture Page Screenshot keyword not fail if browser is not open. | beta 3 |
#891 | bug | medium | Fix setting cookie expiry date | rc 1 |
#898 | bug | medium | "Set Selenium Speed" doesn't work when called before opening browser in release 3.0.0b1 | beta 3 |
#934 | bug | medium | Regressions in Dismiss Alert and Confirm Action compared to 1.8 |
rc 1 |
#990 | bug | medium | Bugs finding table cells when row has both td and th elements |
rc 1 |
#502 | enhancement | medium | Capture Page Screenshot should not overwrite if file already exist | alpha 1 |
#673 | enhancement | medium | Support locating elements using element class | alpha 1 |
#703 | enhancement | medium | Update required Robot Framework version to 2.8 | alpha 1 |
#704 | enhancement | medium | Increase the required selenium version to latest selenium 2 version | alpha 1 |
#719 | enhancement | medium | Use booleans arguments like in Robot Framework | alpha 1 |
#722 | enhancement | medium | Enhance Get List Items to support returning values or labels |
alpha 1 |
#805 | enhancement | medium | Modify Get Webelements not to raise exception when no elements are found | beta 3 |
#851 | enhancement | medium | Add keyword that checks focus | alpha 1 |
#883 | enhancement | medium | Remove SeleniumLibrary profile for Firefox | beta 3 |
#932 | enhancement | medium | Add keyword to get all cookie information | rc 1 |
#942 | enhancement | medium | Support configurable timeout with alert related keywords | rc 1 |
#966 | enhancement | medium | Cleaning up locating windows | rc 1 |
#977 | enhancement | medium | Get Selected List Values/Labels keywords should not fail if list has no selections |
rc 1 |
#987 | enhancement | medium | New Unselect All From List keyword |
rc 1 |
#988 | enhancement | medium | Deprecate Select From List and Unselect From List |
rc 1 |
#592 | bug | low | Deprecation warning from Selenium when using Select/Unselect Frame |
alpha 1 |
#759 | bug | low | Change link in help Get Alert Message to Dismiss Alert |
alpha 1 |
#847 | bug | low | Remove unused expiry argument from Add Cookie keyword |
alpha 1 |
#962 | bug | low | Some checkbox keywords work also with radio buttons | rc 1 |
#985 | bug | low | Set Screenshot Directory is inconsistent with other Set ... keywords |
rc 1 |
#715 | enhancement | low | Support returning int from Get Matching Xpath Count |
alpha 1 |
#794 | enhancement | low | Extend xpath detection to support xpath starting with (// | alpha 1 |
#920 | enhancement | low | Better names for Current Frame Contains , Focus and Simulate |
beta 3 |
#943 | enhancement | low | Wait For Condition should validate that condition contains return |
rc 1 |
#949 | enhancement | low | Enhancements to getting and validating element counts | rc 1 |
#958 | enhancement | low | Wait Until Element Is Enabled should also check readonly status |
rc 1 |
#961 | enhancement | low | Make it an error to unregister a locator strategy that hasn't been registered | rc 1 |
Altogether 52 issues. View on the issue tracker.