diff --git a/appium/webdriver/webdriver.py b/appium/webdriver/webdriver.py index a40336da..956c14e6 100644 --- a/appium/webdriver/webdriver.py +++ b/appium/webdriver/webdriver.py @@ -227,7 +227,7 @@ def __init__( # noqa: PLR0913 self.error_handler = MobileErrorHandler() - if client_config.direct_connection: + if client_config and client_config.direct_connection: self._update_command_executor(keep_alive=client_config.keep_alive) # add new method to the `find_by_*` pantheon diff --git a/test/unit/webdriver/webdriver_test.py b/test/unit/webdriver/webdriver_test.py index 90d4fcca..e85f92a9 100644 --- a/test/unit/webdriver/webdriver_test.py +++ b/test/unit/webdriver/webdriver_test.py @@ -21,7 +21,7 @@ from appium import webdriver from appium.options.android import UiAutomator2Options from appium.webdriver.appium_connection import AppiumConnection -from appium.webdriver.client_config import AppiumClientConfg +from appium.webdriver.client_config import AppiumClientConfig from appium.webdriver.webdriver import ExtensionBase, WebDriver from test.helpers.constants import SERVER_URL_BASE from test.unit.helper.test_helper import ( @@ -125,7 +125,7 @@ def test_create_session_register_uridirect(self): 'app': 'path/to/app', 'automationName': 'UIAutomator2', } - client_config = AppiumClientConfg(remote_server_addr=SERVER_URL_BASE, direct_connection=True) + client_config = AppiumClientConfig(remote_server_addr=SERVER_URL_BASE, direct_connection=True) driver = webdriver.Remote( SERVER_URL_BASE, options=UiAutomator2Options().load_capabilities(desired_caps), @@ -166,7 +166,7 @@ def test_create_session_register_uridirect_no_direct_connect_path(self): 'app': 'path/to/app', 'automationName': 'UIAutomator2', } - client_config = AppiumClientConfg(remote_server_addr=SERVER_URL_BASE, direct_connection=True) + client_config = AppiumClientConfig(remote_server_addr=SERVER_URL_BASE, direct_connection=True) driver = webdriver.Remote( SERVER_URL_BASE, options=UiAutomator2Options().load_capabilities(desired_caps), client_config=client_config )