Failed to establish a new connection with UFT Mobile Server using Appium and python


I use python and appium to connect UFTM server, a error pop up with the message 

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x000001A5AED2C648>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

When I use appium inspector to connect the device, it succeed. But using python and appium to connect it, it always failed to connect.

Followings are wo code, which parts I missed?

from appium import webdriver

desired_caps = {
'platformName': 'Android',
'platformVersion': '10',
'deviceName': 'Galaxy S10',
'appPackage': 'com.foreverht.workplus.hcbmpre',
'appActivity': 'com.foreveross.atwork.modules.main.activity.SplashActivity',
'unicodeKeyboard': True,
'resetKeyboard': True,
'noReset': True,
'newCommandTimeout': 6000,
'automationName': 'UiAutomator2',
'oauthClientId': '',
'oauthClientSecret': 'xxxxxxxx',
'tenantId': '999999999'

driver = webdriver.Remote(r'https://xxxx:443/wd/hub', desired_caps)
# xxxx:443 is the UFT Mobile Server URL

print('create driver session successfully')

Parents Reply
  • 0   in reply to l_rolfe

    The sample code is written by Java and it works, but when I use python to program it still failed, I am not sure that if there is something wrong in the python code. 

No Data