Repository navigation
DeprecationWarnings on selenium 4 #283
Description
Activity
Working on it.
Reacted by Jim BrännlundWorking on it.
Hey.
Between the 15th and 22nd of December, I'm taking vacation with the explicit purpose of working on this plugin (and the other plugins I maintain).
Would you be interested in helping me during that time? Mainly with reviewing PRs and maybe triaging issues?
If you are please shoot me an email at jimbrannlund at fastmail dot com.
Maybe @ssbarnea and @gnikonorov are able to help out as well? 🙇
will continue after #282 is merged
Merged @dosas 😊
Reacted by dosasv4.0.0 was just released. Any updates here?
I have been trying to work on it but could not get it done on time. The desired capabilities are an essential part of this plugin for the cloud based drivers.
I pushed some of the work to this fork
Seeing this with Python Selenium 4.5 and pytest-selenium 4.0.0
========== warnings summary =========== tests/selenium/test_milestones.py::TestMilestones::test_add_new_to_ip_with_required_attr /home/dborin/.pyenv/versions/3.9.6/envs/upgrade-pytest-packages/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py:69: DeprecationWarning: desired_capabilities has been deprecated, please pass in a Service object super().__init__(DesiredCapabilities.CHROME['browserName'], "goog", tests/selenium/test_milestones.py::TestMilestones::test_add_new_to_ip_with_required_attr /home/dborin/.pyenv/versions/3.9.6/envs/upgrade-pytest-packages/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py:69: DeprecationWarning: service_log_path has been deprecated, please pass in a Service object super().__init__(DesiredCapabilities.CHROME['browserName'], "goog", -- Docs: https://docs.pytest.org/en/stable/warnings.html ============== 1 passed, 2 warnings in 11.74s ========Seeing this with Python Selenium 4.5 and pytest-selenium 4.0.0
========== warnings summary =========== tests/selenium/test_milestones.py::TestMilestones::test_add_new_to_ip_with_required_attr /home/dborin/.pyenv/versions/3.9.6/envs/upgrade-pytest-packages/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py:69: DeprecationWarning: desired_capabilities has been deprecated, please pass in a Service object super().__init__(DesiredCapabilities.CHROME['browserName'], "goog", tests/selenium/test_milestones.py::TestMilestones::test_add_new_to_ip_with_required_attr /home/dborin/.pyenv/versions/3.9.6/envs/upgrade-pytest-packages/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py:69: DeprecationWarning: service_log_path has been deprecated, please pass in a Service object super().__init__(DesiredCapabilities.CHROME['browserName'], "goog", -- Docs: https://docs.pytest.org/en/stable/warnings.html ============== 1 passed, 2 warnings in 11.74s ========Would you mind creating a small repro repo?
It really speeds up my ability to solve the issue. 🙏 🙇
Maybe hold off on that, as I think the repo created for me in this issue: #284 actually covers this issue as well.
Hello, since yesterday (release 4.10.0 of Selenium, https://github.com/SeleniumHQ/selenium/releases/tag/selenium-4.10.0), this warning is no more a warning but is causing the code to fail:
Traceback (most recent call last): File "/opt/venv/lib/python3.9/site-packages/pytest_selenium/pytest_selenium.py", line 200, in driver for retry in Retrying( File "/opt/venv/lib/python3.9/site-packages/tenacity/__init__.py", line 347, in __iter__ do = self.iter(retry_state=retry_state) File "/opt/venv/lib/python3.9/site-packages/tenacity/__init__.py", line 325, in iter raise retry_exc.reraise() File "/opt/venv/lib/python3.9/site-packages/tenacity/__init__.py", line 158, in reraise raise self.last_attempt.result() File "/usr/lib/python3.9/concurrent/futures/_base.py", line 433, in result return self.__get_result() File "/usr/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result raise self._exception File "/opt/venv/lib/python3.9/site-packages/pytest_selenium/pytest_selenium.py", line 207, in driver driver = driver_class(**driver_kwargs) TypeError: __init__() got an unexpected keyword argument 'desired_capabilities'Versions:
OS: Debian 11
Python: 3.9.2
pytest: 7.3.1
pytest-selenium: 4.0.1Regards
Reacted by Jim Brännlund, Tobias Reiher and Robert SchwebelAny progress on this? The issue does now exist for 1.5 years, and pytest-selenium becomes increasingly unusable these days.
I tried to fix this in a local fork but I failed even to find a combination of the dependencies so the tests can run successfully. So I had to give up. 😢
Here is what I did:
- I added
pyas a dependency, see Missing dependency onpypackage #313. - I downgraded
seleniumto<4.10which fixed some tests which are broken when using with a current selenium version. (12 failed, 88 passed, 3 skipped, 6 xfailedfor Python 3.11 as well as for Python 3.8) - The output of
pytest-html 4.xalso changed, but downgrading it to3.2,3.1.1,3.0.0or even to<3did not help to fix the tests which assert certain HTML snippets in the output.
Reacted by Jim Brännlund- I added
@icemac Thanks for the effort, it's greatly appreciated.
But given all the changes to Selenium (and now pytest-html) coupled with the lack of love this plugin has received - I think a rewrite is required.
I don't know when I'll have the time to do that. Especially since pytest-html is still taking up a lot of time.
When running a customer project's tests I get the following deprecation warnings:
Using
pytest-selenium = 2.0.1onselenium = 4.1.0.