|
23 | 23 | ) |
24 | 24 | from selenium.webdriver.common.by import By |
25 | 25 | from selenium.webdriver.remote.command import Command as RemoteCommand |
| 26 | +from selenium.webdriver.remote.file_detector import FileDetector |
26 | 27 | from selenium.webdriver.remote.remote_connection import RemoteConnection |
27 | 28 | from typing_extensions import Self |
28 | 29 |
|
@@ -204,18 +205,23 @@ class WebDriver( |
204 | 205 | ): |
205 | 206 | def __init__( # noqa: PLR0913 |
206 | 207 | self, |
207 | | - command_executor: Union[str, AppiumConnection] = 'http://127.0.0.1:4444', |
| 208 | + command_executor: Union[str, AppiumConnection] = 'http://127.0.0.1:4723', |
208 | 209 | extensions: Optional[List['WebDriver']] = None, |
| 210 | + file_detector: Optional[FileDetector] = None, |
209 | 211 | options: Union[AppiumOptions, List[AppiumOptions], None] = None, |
210 | 212 | client_config: Optional[AppiumClientConfig] = None, |
211 | 213 | ): |
212 | 214 | if isinstance(command_executor, str): |
213 | 215 | if client_config is None: |
214 | 216 | client_config = AppiumClientConfig(remote_server_addr=command_executor) |
| 217 | + else: |
| 218 | + client_config.remote_server_addr = command_executor |
| 219 | + # To prevent generating RemoteConnection in selenium |
215 | 220 | command_executor = AppiumConnection(client_config=client_config) |
216 | 221 |
|
217 | 222 | super().__init__( |
218 | 223 | command_executor=command_executor, |
| 224 | + file_detector=file_detector, |
219 | 225 | options=options, |
220 | 226 | locator_converter=AppiumLocatorConverter(), |
221 | 227 | web_element_cls=MobileWebElement, |
|
0 commit comments