appium / appium/python-client

Parallel usage results in a "socket hang up" error. systemPort have set but still have the problem.

オープン
#903 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

NeedsInfo
主要言語
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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. 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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。