使用Appium自动执行UWP应用时,接收ProtocolError-RemoteDisconnected

时间:2019-09-23 10:00:25

标签: uwp

我是自动化的新手。我正在将appium与python结合使用以自动化使用Xamarin Framework开发的UWP app。我创建了登录页面测试。运行测试时,我收到以下协议错误3/5次。 Appium使用WinAppDriver来自动执行UWP。请让我知道原因是什么

Traceback (most recent call last):
  File "D:\Python37\lib\site-packages\urllib3\connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "D:\Python37\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "D:\Python37\lib\site-packages\urllib3\connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "D:\Python37\lib\http\client.py", line 1336, in getresponse
    response.begin()
  File "D:\Python37\lib\http\client.py", line 306, in begin
    version, status, reason = self._read_status()
  File "D:\Python37\lib\http\client.py", line 275, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\MobileTesting\SVN\branches\CompassAutomation_v0.0.1.0\tests_mobile\Login.py", line 51, in test_InvalidLogin
    self.assertTrue(Errors.loginValidationError(self.driver))
  File "D:\MobileTesting\SVN\branches\CompassAutomation_v0.0.1.0\MobileLib\Pages\Errors.py", line 10, in loginValidationError
    errorMsg = driver.find_element_by_xpath("//Text[@Name='There was a problem connecting to the authentication server']")
  File "D:\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "D:\Python37\lib\site-packages\appium\webdriver\webdriver.py", line 276, in find_element
    'value': value})['value']
  File "D:\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 319, in execute
    response = self.command_executor.execute(driver_command, params)
  File "D:\Python37\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 374, in execute
    return self._request(command_info[0], url, body=data)
  File "D:\Python37\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 397, in _request
    resp = self._conn.request(method, url, body=body, headers=headers)
  File "D:\Python37\lib\site-packages\urllib3\request.py", line 72, in request
    **urlopen_kw)
  File "D:\Python37\lib\site-packages\urllib3\request.py", line 150, in request_encode_body
    return self.urlopen(method, url, **extra_kw)
  File "D:\Python37\lib\site-packages\urllib3\poolmanager.py", line 326, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "D:\Python37\lib\site-packages\urllib3\connectionpool.py", line 641, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "D:\Python37\lib\site-packages\urllib3\util\retry.py", line 368, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "D:\Python37\lib\site-packages\urllib3\packages\six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "D:\Python37\lib\site-packages\urllib3\connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "D:\Python37\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "D:\Python37\lib\site-packages\urllib3\connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "D:\Python37\lib\http\client.py", line 1336, in getresponse
    response.begin()
  File "D:\Python37\lib\http\client.py", line 306, in begin
    version, status, reason = self._read_status()
  File "D:\Python37\lib\http\client.py", line 275, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

0 个答案:

没有答案