Parallel usage results in a "socket hang up" error. systemPort have set but still have the problem.
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start by reproducing the two-thread test with the two Android devices, using the shown webdriver.Remote endpoint and distinct systemPort values. Inspect the Appium server output and session-creation errors to identify why one session reports a socket hang up; done means both sessions run the tap and quit successfully in parallel.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 570
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 24
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from appium/python-client
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
appium/python-client#1230 · 1 comment ·
Maintainers usually reply within 3 days
-
question
Difficulty 4/5 3-5 days Newbie friendliness 25/100
appium/python-client#1168 · 9 comments ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
appium/python-client#1147 · 7 comments ·
Maintainers usually reply within 3 days
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
appium/python-client#1091 · 4 comments ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
appium/python-client#1076 · 2 comments ·
Maintainers usually reply within 3 days
All issues in appium/python-client
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
solana-foundation/pay-kit#341 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nasa/python_cmr#123 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
EleutherAI/lm-evaluation-harness#4243 ·
Maintainers usually reply within 1 day
-
area: dashboard bug perceived difficulty: 3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Nitjsefnie-Harness-Commons/daedalus#1179 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
cusp-ai-oss/tojax#17 ·