Parallel usage results in a "socket hang up" error. systemPort have set but still have the problem.
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 1.8k
- フォーク
- 570
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 24
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、2 台の Android デバイスで、示されている webdriver.Remote エンドポイントと異なる systemPort 値を使用して、2 スレッドのテストを再現します。Appium サーバーの出力とセッション作成エラーを調べ、1 つのセッションで socket hang up が報告される理由を特定します。両方のセッションが並列で tap を実行し、正常に終了すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, python
- 領域
- mobile, testing
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100