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

[🐛 Bug]: AttributeError: 'AppiumConnection' object has no attribute '_ca_certs' #14694

Closed
Trouler opened this issue Oct 31, 2024 · 7 comments · Fixed by #14696
Closed

[🐛 Bug]: AttributeError: 'AppiumConnection' object has no attribute '_ca_certs' #14694

Trouler opened this issue Oct 31, 2024 · 7 comments · Fixed by #14696

Comments

@Trouler
Copy link

Trouler commented Oct 31, 2024

What happened?

We are automating actions on both an Android phone on Windows, and on a Iphone on macOS. The macOS automation stopped working in the latest update, with this error:
AttributeError: 'AppiumConnection' object has no attribute '_ca_certs'

It's happening when attempting to initiate a Remote WebDriver

How can we reproduce the issue?

Will be removing quite a lot of internal code here, but hopefully relevant code is enough to figure out why it happens.
---------------------------------------------------------

from appium.webdriver import Remote
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService

options = XCUITestOptions()
options.set_capability("newCommandTimeout", 3000)
options.device_name = "SECRET"
options.platform_version = "16.4"
options.automation_name = "XCUITest"
options.show_xcode_log = True
options.xcode_org_id = "SECRET"
options.xcode_signing_id = "iPhone Developer"
options.udid = "SECRET"

host = "localhost"
port = "4723"

appium_service = AppiumService()
appium_service.start(args=["--address", host, "--port", port], main_script="/usr/local/bin/appium")
assert appium_service.is_running
driver = Remote(f"http://{host}:{port}", options=options)

Relevant log output

self.driver = Remote(f"http://{appium_host}:{appium_port}", options=options)
.venv/lib/python3.12/site-packages/appium/webdriver/webdriver.py:227: in __init__
    command_executor = AppiumConnection(command_executor, keep_alive=keep_alive)
.venv/lib/python3.12/site-packages/appium/webdriver/appium_connection.py:43: in __init__
    super().__init__(remote_server_addr, keep_alive=keep_alive, ignore_proxy=ignore_proxy)
.venv/lib/python3.12/site-packages/selenium/webdriver/remote/remote_connection.py:340: in __init__
    self._conn = self._get_connection_manager()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <appium.webdriver.appium_connection.AppiumConnection object at 0x1101eedb0>
    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'
.venv/lib/python3.12/site-packages/appium/webdriver/appium_connection.py:49: AttributeError

Operating System

macOS

Selenium version

4.26.0

What are the browser(s) and version(s) where you see this issue?

Chrome

What are the browser driver(s) and version(s) where you see this issue?

Not sure

Are you using Selenium Grid?

No response

Copy link

@Trouler, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@VietND96
Copy link
Member

First, can you try to pin selenium python to version 4.25.0?

@VietND96
Copy link
Member

Hi @KazuCocoa, could you please review this can be resolved once this PR appium/python-client#1054 is implemented on top of 4.26.0?

@Trouler
Copy link
Author

Trouler commented Oct 31, 2024

First, can you try to pin selenium python to version 4.25.0?

Yes sorry, I should probably have added that in the issue description. We are currently working around it by pinning, so 4.25.0 is working fine.

@KazuCocoa
Copy link
Contributor

Np, I'll release a new Python client with up to 4.25.0 anyway. 4.26.0+ will be a new version with planned modifications in appium/python-client#1054

This was not expected one as not it was in #14587 though. For me, maybe #14692 will bring more impact for Appium users who use Appium on slow spec CI machine. I'll update appium python client's README as well for 4.26+ selenium bindings update in our project.

@VietND96
Copy link
Member

I added back those 2 attrs in class RemoteConnection. It will probably work in patch 4.26.1

@KazuCocoa
Copy link
Contributor

Sure. I'll release a new Python client with up to 4.25 anyway since we need to prepare some documentation like request timeout thing with a new version update based on 4.26.

@VietND96 VietND96 added the C-py label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants