robotframework / SeleniumLibrary

Web testing library for Robot Framework
Apache License 2.0
1.38k stars 761 forks source link

Update SeleniumLibrary to be compatable with Selenium v4.10.0 #1836

Closed emanlove closed 1 year ago

emanlove commented 1 year ago

Selenium v4.10.0 removed some deprecated code which broke SeleniumLibrary. This is a hotfix to correct that and make SeleniumLibrary compatible.

bollwyvl commented 1 year ago

Thanks for making this issue.

This seems relevant to #1829 : e.g. extending the test matrix proposed there to include a "latest" upstream would catch future issues like this. Unfortunately, selenium doesn't appear to do pre-releases on PyPI, and building selenium from source is... non-trival, involving bazel and additional wrapper tools... or risking Doing It Wrong. I gave up on the conda-forge downstream, and for a while, we were doubly-doomed, as the upstream was only publishing .whl files.

emanlove commented 1 year ago

I was thinking the same that #1829 has some relevance here. Initial thought was to add a check for the word "deprecated" (or the like) within the code. I plan on writing a public retrospective after the fact to explain and give a perspective to the community.

bollwyvl commented 1 year ago

check for the word "deprecated" (or the like) within the code

Again, see there's a lot of generated code, so this would be... hard.

But, given a working selenium, pytest could help out a lot, by turning warnings into errors:

[tool.pytest.ini_options]
filterwarnings = [
  "error",
  # and ignore some things that can't be controlled
  # "ignore:pkg_resources:DeprecationWarning",
]

I'm not familiar with a similar approach for robot itself, however...

emanlove commented 1 year ago

@bollwyvl we should sit and talk sometime as I know I could learn a few things about your approach with #1829 and this.

lugi0 commented 1 year ago

Hello @emanlove , is there an ETA for the hotfix being released?

emanlove commented 1 year ago

@lugi0 Not at this time. I was hoping for this past Monday. I hit a snag with the mocking done by our internal tests. And this week I had a lot of personal work that needed to be done and had little spare time.

emanlove commented 1 year ago

A release candidate v6.1.1rc1 has been pushed to PyPI which is intended to resolve this issue. If you have pip installed, just run

pip install --pre --upgrade robotframework-seleniumlibrary to install this release candidate or as I prefer use

pip install robotframework-seleniumlibrary==6.1.1rc1 to install exactly this version. The changes are all internal and very subtle. I recommend people do some check under certain conditions to verify this is working for you as it did previously based upon how you use the Open Browser keyword. Notes about this are in the release notes for v6.1.1rc1 and can be found at https://github.com/robotframework/SeleniumLibrary/blob/master/docs/SeleniumLibrary-6.1.1rc1.rst

Please read through these thoroughly and follow the recommended verification steps before one comments. Thank you.

emanlove commented 1 year ago

This has been fixed