I'm trying to run a Python automation using Appium, when I try to run the script, this is the error I am getting.
Logs:
Traceback (most recent call last): File "E:\Projects\Python\Indee\pythonProject\TestCases\testCase1.py", line 31, in driver = webdriver.Remote(url, options=AppiumOptions().load_capabilities(cap)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Projects\Python\Indee\pythonProject.venv\Lib\site-packages\appium\webdriver\webdriver.py", line 227, in init command_executor = AppiumConnection(command_executor, keep_alive=keep_alive) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Projects\Python\Indee\pythonProject.venv\Lib\site-packages\appium\webdriver\appium_connection.py", line 43, in init super().init(remote_server_addr, keep_alive=keep_alive, ignore_proxy=ignore_proxy) File "E:\Projects\Python\Indee\pythonProject.venv\Lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 340, in init self._conn = self._get_connection_manager() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Projects\Python\Indee\pythonProject.venv\Lib\site-packages\appium\webdriver\appium_connection.py", line 49, in _get_connection_manager if self._ca_certs: ^^^^^^^^^^^^^^ AttributeError: 'AppiumConnection' object has no attribute '_ca_certs'
Process finished with exit code 1
Edit: Adding the code I am running -
import time
from typing import Dict, Any
from wsgiref.util import application_uri
from appium import webdriver
from appium.options.common import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
from appium.webdriver.appium_service import AppiumService
cap:Dict[str, Any]={
'platformname':'Android',
'automationName':'uiautomator2',
'deviceName':'Android',
'appPackage':'com.android.settings',
'appActivity':'.Settings',
'language':'en',
'locale':'US'
}
url = 'http//localhost:4723'
# app = 'E:\\Projects\\Python\\Indee\\pythonProject\\resources\\hfiPevjjJ1DgrIGU5G3n.apk'
# appium_service = AppiumService()
# appium_service.start()
driver = webdriver.Remote(url, options=AppiumOptions().load_capabilities(cap))
print("Running")
# appium_service.stop()
I too, am encountering this issue. I fixed it by pegging selenium. I have a couple of setups running appium and one was exhibiting this issue, but the other was not. After running an update on the packages, this appeared in the system that was previously working. I looked at the logs and noticed
- Updating selenium (4.25.0 -> 4.26.0)
I then pegged selenium to 4.25.0 and it started working again.
Note - a semver update of the minor should not break the api, but, appium is addressing a private var in selenium (_ca_certs
). A private variable is not intended to be used by a consumer and is not guaranteed to remain stable. While pegging selenium may fix the issue for you, ultimately, the appium package should not be relying on private variable access from the selenium package.
I reported this here https://github.com/appium/appium/issues/20713 In the meantime, selenium 4.25.0 works.