Appium-API-Status

本文介绍了一种方法,用于检查远程端口的连接状态,确定其是否可以创建新的会话。通过Python的selenium库中webdriver.common.utils模块的is_url_connectable函数,可以判断给定端口的当前状态是否允许建立新连接。然而,即使返回true,也不能完全保证New Session命令一定成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Status

Java:// TODO

Python:selenium.webdriver.common.utils.is_url_connectable(port)

Description

Returns information about whether a remote end is in a state in which it can create new sessions and can additionally include arbitrary meta information that is specific to the implementation.
The readiness state is represented by the ready property of the body, which is false if an attempt to create a session at the current time would fail. However, the value true does not guarantee that a New Session command will succeed.
Implementations may optionally include additional meta information as part of the body, but the top-level properties ready and message are reserved and must not be overwritten

adb shell stop surfaceflinger # 停止渲染服务,我执行这个命令后,手机确实黑屏了,但是我运行appium框架写的用例文件,报错获取驱动时出错: Message: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'D:\\python\\auto_deploy_hytest\\androidsdk\\platform-tools\\adb.exe -P 5037 -s 5YLBB25604200149 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy'' exited with code 20'; Stderr: 'cmd: Can't find service: settings cmd: Can't find service: settings cmd: Can't find service: settings'; Code: '20' Stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'D:\\python\\auto_deploy_hytest\\androidsdk\\platform-tools\\adb.exe -P 5037 -s 5YLBB25604200149 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy'' exited with code 20'; Stderr: 'cmd: Can't find service: settings cmd: Can't find service: settings cmd: Can't find service: settings'; Code: '20' at getResponseForW3CError (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9) at asyncHandler (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)
最新发布
08-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值