Parallel usage results in a "socket hang up" error. systemPort have set but still have the problem.
还没有人认领这个 Issue。
评估
调研方向
首先使用两个 Android 设备复现双线程测试,并使用所示的 webdriver.Remote 端点和不同的 systemPort 值。检查 Appium 服务器输出和会话创建错误,以确定为什么其中一个会话报告 socket hang up;当两个会话并行执行 tap 并成功退出时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Here's my code:
python
from appium import webdriver
from appium.webdriver.common.touch_action import TouchAction
import threading
Device 1's configuration
desired_caps1 = {
"appium:appActivity": ".Settings",
"appium:appPackage": "com.android.settings",
"appium:automationName": "uiautomator2",
"appium:udid": "xxxx",
"platformName": "Android",
"appium:systemPort": 8310
}
Device 2's configuration
desired_caps2 = {
"appium:appActivity": ".Settings",
"appium:appPackage": "com.android.settings",
"appium:automationName": "uiautomator2",
"appium:udid": "192.168.137.58:5555",
"platformName": "Android",
"appium:systemPort": 8322
}
def run_test_on_device(desired_caps):
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps) # Corrected URL
width = driver.get_window_size()["width"]
height = driver.get_window_size()["height"]
action = TouchAction(driver)
action.tap(x=width // 2, y=height // 2).perform()
driver.quit()
Use threading for parallel execution
thread1 = threading.Thread(target=run_test_on_device, args=(desired_caps1,))
thread2 = threading.Thread(target=run_test_on_device, args=(desired_caps2,))
thread1.start()
thread2.start()
thread1.join()
thread2.join()
I have set the different systemPort for each devices, but I still have the problem.
How can I sove that, I'm very need to be solved, thanks.
- 主要语言
- Python
- 星标
- 1.8k
- 派生
- 570
- 平均合并
- 1 天 10 小时
- 30 天内合并 PR
- 24
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
appium/python-client 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
appium/python-client#1230 · 1 条评论 ·
-
question
难度 4/5 3-5 天 新手友好度 25/100
appium/python-client#1168 · 9 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 55/100
appium/python-client#1147 · 7 条评论 ·
-
难度 3/5 1-2 天 新手友好度 38/100
appium/python-client#1091 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
appium/python-client#1076 · 2 条评论 ·
查看 appium/python-client 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
-
hcocena 未关闭policies-accepted pre-review precheck-passed
难度 1/5 1 小时以内 新手友好度 88/100
Bioconductor/BiocContributions#214 · 5 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
TencentCloud/Octop#1169 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
521xueweihan/HelloGitHub#3778 ·
-
The version checker's trailing attribute region has no control for a less-than inside a quoted value 未关闭area: dashboard area: tests bug perceived difficulty: 2 python
难度 2/5 1-3 小时 新手友好度 84/100
Nitjsefnie-Harness-Commons/daedalus#1105 · 1 条评论 ·