AppiumDriver类架构

本文详细介绍了Appium在移动应用自动化测试领域的应用实践,包括其核心概念、配置步骤、常见问题解决策略及实际案例分析,旨在帮助开发者提高测试效率,确保软件质量。
<code style="margin:0px; padding:0px; border:0px; vertical-align:baseline; font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif; white-space:inherit"><span class="kwd" style="color:#008b;margin:0px; padding:0px; border:0px; vertical-align:baseline; background-color:transparent;"></span></code><p style="color:rgb(51,51,51); font-family:Arial; font-size:14px; line-height:26px">原文:<a target=_blank target="_blank" href="http://blog.youkuaiyun.com/yushuanggui/article/details/34829717">http://blog.youkuaiyun.com/yushuanggui/article/details/34829717</a><img src="https://img-blog.youkuaiyun.com/20140626120349375?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveXVzaHVhbmdndWk=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" style="white-space:inherit; border:none; max-width:100%" /></p><p style="color:rgb(51,51,51); font-family:Arial; font-size:14px; line-height:26px">
</p>
C:\own\app\python_code\.venv\Scripts\python.exe C:\own\app\python_code\work\IBL_click_all\click_all.py Traceback (most recent call last): File "C:\own\app\python_code\work\IBL_click_all\click_all.py", line 25, in <module> driver = webdriver.Remote( command_executor='http://localhost:4723', # Appium Server 地址 options=options # 使用 options 替代 desired_caps ) File "C:\own\app\python_code\.venv\Lib\site-packages\appium\webdriver\webdriver.py", line 249, in __init__ super().__init__( ~~~~~~~~~~~~~~~~^ command_executor=command_executor, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<3 lines>... client_config=client_config, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "C:\own\app\python_code\.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 261, in __init__ self.start_session(capabilities) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "C:\own\app\python_code\.venv\Lib\site-packages\appium\webdriver\webdriver.py", line 342, in start_session response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps) File "C:\own\app\python_code\.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 454, in execute self.error_handler.check_response(response) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "C:\own\app\python_code\.venv\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 232, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Could not find a driver for automationName 'UiAutomator2' and platformName 'Android'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see. (Lower-level error: Could not find installed driver to support given caps) Stacktrace: UnknownError: Could not find a driver for automationName 'UiAutomator2' and platformName 'Android'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see. (Lower-level error: Could not find installed driver to support given caps) at getResponseForW3CError (C:\own\app\Node\node_global\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\errors.ts:1103:34) at asyncHandler (C:\own\app\Node\node_global\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\protocol.ts:507:57) The above error is caused by Error: Could not find a driver for automationName 'UiAutomator2' and platformName 'Android'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see. (Lower-level error: Could not find installed driver to support given caps) at DriverConfig.findMatchingDriver (C:\own\app\Node\node_global\node_modules\appium\lib\extension\driver-config.js:173:13) at AppiumDriver.createSession (C:\own\app\Node\node_global\node_modules\appium\lib\appium.js:303:35) at runCommandPromise (C:\own\app\Node\node_global\node_modules\appium\node_modules\@appium\base-driver\lib\basedriver\driver.ts:116:20) at AppiumDriver.executeCommand (C:\own\app\Node\node_global\node_modules\appium\node_modules\@appium\base-driver\lib\basedriver\driver.ts:161:15) at processTicksAndRejections (node:internal/process/task_queues:105:5) at defaultBehavior (C:\own\app\Node\node_global\node_modules\appium\lib\appium.js:726:16) at AppiumDriver.executeWrappedCommand (C:\own\app\Node\node_global\node_modules\appium\lib\appium.js:843:16) at AppiumDriver.executeCommand (C:\own\app\Node\node_global\node_modules\appium\lib\appium.js:742:17) at asyncHandler (C:\own\app\Node\node_global\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\protocol.ts:409:19) Process finished with exit code 1
10-16
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值