Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'AppiumConnection' object has no attribute '_ca_certs' #1053

Closed
tking16 opened this issue Oct 30, 2024 · 6 comments
Closed

'AppiumConnection' object has no attribute '_ca_certs' #1053

tking16 opened this issue Oct 30, 2024 · 6 comments

Comments

@tking16
Copy link

tking16 commented Oct 30, 2024

I'm getting a new error all of a sudden as soon as I try to start up any tests

_env/lib/python3.9/site-packages/pytest_appium/conftest.py:175:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_env/lib/python3.9/site-packages/pytest_appium/conftest.py:77: in driver
    driver = driver_class(**driver_kwargs)
_env/lib/python3.9/site-packages/appium/webdriver/webdriver.py:257: in __init__
    super().__init__(
_env/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py:238: in __init__
    self.start_session(capabilities)
_env/lib/python3.9/site-packages/appium/webdriver/webdriver.py:346: in start_session
    response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
_env/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py:378: in execute
    response = self.command_executor.execute(driver_command, params)
_env/lib/python3.9/site-packages/selenium/webdriver/remote/remote_connection.py:376: in execute
    return self._request(command_info[0], url, body=data)
_env/lib/python3.9/site-packages/selenium/webdriver/remote/remote_connection.py:403: in _request
    conn = self._get_connection_manager()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <appium.webdriver.appium_connection.AppiumConnection object at 0x103b880d0>

    def _get_connection_manager(self) -> Union[urllib3.PoolManager, urllib3.ProxyManager]:
        # https://github.com/SeleniumHQ/selenium/blob/0e0194b0e52a34e7df4b841f1ed74506beea5c3e/py/selenium/webdriver/remote/remote_connection.py#L134
        pool_manager_init_args = {'timeout': self.get_timeout()}

>       if self._ca_certs:
E       AttributeError: 'AppiumConnection' object has no attribute '_ca_certs'

_env/lib/python3.9/site-packages/appium/webdriver/appium_connection.py:49: AttributeError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>
> /Users/theo.king/code/guacamole/testing/app-at/_env/lib/python3.9/site-packages/appium/webdriver/appium_connection.py(49)_get_connection_manager()
-> if self._ca_certs:

Environment

  • Appium version (or git revision) that exhibits the issue: v2.12.1
  • Appium-Python-Client: latest v3.2.1

Details

If necessary, describe the problem you have been experiencing in more detail.

Link to Appium Logs

Nothing is coming out of the logs, it fails before it even gets in there

@KazuCocoa
Copy link
Member

Do you use selenium v4.26.0 dependency? Then please use 4.25.0.

I'll work on two things in selenium change:

  • Implement configurable configuration class for the http client (#13286)
  • Better compatibility with Appium-python (#14587)

https://github.com/SeleniumHQ/selenium/blob/trunk/py/CHANGES

#1045
#1051

@tking16
Copy link
Author

tking16 commented Oct 30, 2024

I'm still using Selenium 4.21 for Grid purposes but even trying to run without that is giving me this error

@firelightrpg
Copy link

Adding comments from duplicate report. This is fallout from an update to the selenium library. At least, in my case, I don't see this issue with 4.25.0, but when I built a new environment, with selenium 4.26.0, this started happening.

Note - a semver update of the Selnium's package minor version should not break the api, but, appium is addressing a private variable in selenium (? _ca_certs). A private variable is not intended to be used by a consumer and is not guaranteed to remain stable. While pinning selenium to 4.25.0 may fix the issue for you at present, ultimately, the appium package should not be relying on private variable access from the selenium package.

@eglitise
Copy link

eglitise commented Oct 31, 2024

Just to clarify here:

a semver update of the Selnium's package minor version should not break the api

Even though it may seem like it at first, Selenium does not actually follow semver. This is why the README of this project (and other Appium clients) has a compatibility matrix for Selenium binding versions.

@KazuCocoa
Copy link
Member

Released 4.2.1 with up to selenium bindings 4.25.0.

It looks like selenium 4.26.0 binding introduced request timeout limitation from the beginning so we may need to write thin guidance about the timeout as well with the 4.26.0 update. Let me close this for now as 4.2.1 has a temporary workaround, and working on #1054.

@VietND96
Copy link

VietND96 commented Nov 1, 2024

Selenium Python 4.26.1 is out with adding backward compatibility SeleniumHQ/selenium#14696 for AppiumConnection
Can you verify if it helps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants