Skip to content

Warnings when using Firefox and IE (Python) #9678

@JohnA2

Description

@JohnA2

💥 Regression Report

I noticed that if I run tests using Chrome, there are zero warnings, but with Firefox or IE, Selenium itself produces some deprecation warnings. I know it's only warnings, but the problem is each tests produces 1 or 2 of them. If there are a lot of tests, it takes some time to go over all warnings to check if they are real warnings that should be fixed or they are just these, caused by the Selenium code itself. Selenium 3 didn't have this problem.

Last working Selenium version

Worked up to version: 3.141.0

Stopped working in version: 4.x

To Reproduce

  • Install pytest using pip install pytest.
  • Save the following code to test_warnings.py.
from selenium.webdriver import Chrome, Firefox, Ie

def test_warnings():
    driver = <insert Chrome or Firefox or Ie here>()
    driver.get('http://example.com')
    driver.quit()
  • Execute pytest to run the test case.

Expected behavior

No warnings.

Actual behavior

No warnings with Chrome only. Warnings with Firefox and IE.

================================= warnings summary =================================
test_warnings.py::test_warnings
...\lib\site-packages\selenium\webdriver\firefox\webdriver.py:182: DeprecationWarning: desired_capabilities has been deprecated, please pass in an Options object with options kwarg
RemoteWebDriver.init(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
============================== 1 passed, 1 warning in 9.95s ==============================

================================= warnings summary =================================
test_warnings.py::test_warnings
...\lib\site-packages\selenium\webdriver\ie\webdriver.py:119: DeprecationWarning: desired_capabilities has been deprecated, please pass in an Options object with options kwarg
RemoteWebDriver.init(

test_warnings.py::test_warnings
...\lib\site-packages\selenium\webdriver\ie\webdriver.py:119: DeprecationWarning: keep_alive has been deprecated. We will be using True as the default value as we start removing it.
RemoteWebDriver.init(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
============================== 1 passed, 2 warnings in 5.17s ==============================

Environment

OS: any
Browser: Firefox and Internet Explorer
Browser version: any
Browser Driver version: latest
Language Bindings version: Python 4.0.0b4
Selenium Grid version (if applicable): N/A

Metadata

Metadata

Labels

C-pyPython Bindings

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions