Parallel usage results in a "socket hang up" error. systemPort have set but still have the problem.
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 25/100
研究方向
先使用兩個 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 天 9 小時
- 30 天內合併 PR
- 25
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
appium/python-client 的其他 Issue
-
難度 5/5 一週以上 新手友好度 25/100
appium/python-client#1230 · 1 則留言 ·
維護者通常 1 天內回覆
-
question
難度 4/5 3-5 天 新手友好度 25/100
appium/python-client#1168 · 9 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 55/100
appium/python-client#1147 · 7 則留言 ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 38/100
appium/python-client#1091 · 4 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 25/100
appium/python-client#1076 · 2 則留言 ·
維護者通常 1 天內回覆
查看 appium/python-client 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
PedestrianDynamics/pyFDS-Evac#343 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
theskumar/python-dotenv#708 ·
-
難度 1/5 1 小時以內 新手友好度 88/100
維護者通常 2 天內回覆
-
Docs Timedelta
難度 2/5 1-3 小時 新手友好度 72/100
pandas-dev/pandas#69919 ·
維護者通常 1 天內回覆
-
API documentation
難度 2/5 1-3 小時 新手友好度 72/100
zephyrproject-rtos/west#1009 · 2 則留言 ·
維護者通常 3 天內回覆