robotframework - 使用 JiraRobot 库但无法在 Robot Framework 中连接 Jira
问题描述
我尝试通过以下代码连接 Jira
*** Settings ***
Library JiraRobot
*** Test Cases ***
Test_Connect_Jira
Connect To Jira ${UserID} ${Pass} options= {'server':'${ServerName}'}
Log Get Current User
我有错误
[ WARN ] ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host')) while doing GET https://jira.xxx.com/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.24.0', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
[ WARN ] Got ConnectionError [('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))] errno:None on GET https://jira.xxx.com/rest/api/2/serverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
[ WARN ] Got recoverable error from GET https://jira.xxx.com/rest/api/2/serverInfo, will retry [1/3] in 0.531449693973s. Err: ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))
[ WARN ] ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host')) while doing GET https://jira.xxx.com/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.24.0', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
[ WARN ] Got ConnectionError [('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))] errno:None on GET https://jira.xxx.com/rest/api/2/serverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
[ WARN ] Got recoverable error from GET https://jira.xxx.com/rest/api/2/serverInfo, will retry [2/3] in 3.70011506578s. Err: ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))
[ WARN ] ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host')) while doing GET https://jira.xxx.com/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.24.0', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
[ WARN ] Got ConnectionError [('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))] errno:None on GET https://jira.xxx.com/rest/api/2/serverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
[ WARN ] Got recoverable error from GET https://jira.xxx.com/rest/api/2/serverInfo, will retry [3/3] in 50.5519016195s. Err: ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))
[ WARN ] ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host')) while doing GET https://jira.xxx.com/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.24.0', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
[ ERROR ] Execution stopped by user.
Authentication to JIRA unsuccessful. Ensure the user used has sufficient access and that Username and Password were correct
Process finished with exit code 253
但我实际上是通过这些用户名和密码手动登录的。
任何有经验的人请帮助我。
解决方案
The below keyword worked for me.
*** Settings ***
Library RequestsLibrary
Library JiraRobot
*** Keywords ****
Connect To Jira
Connect To Jira username password options={'rest_api_version': '2', 'verify': True, 'server': 'Jira URL', 'headers': {'X-Atlassian-Token': 'nocheck'}, 'rest_path': 'api', 'resilient': 'False', 'async': 'False'}
Also, make sure that the library is available.
pip install JiraRobot
推荐阅读
- sockets - Octave 中的 pkg 负载插座
- openmdao - 一个组中的半个组不使用相同的输入
- laravel - Laravel:使用队列每小时发送 1000 封电子邮件
- c++ - Array Length,为什么从命令行获取时不能使用?
- google-bigquery - 我可以从 bigquery 导出到使用不同凭据访问的存储桶吗?
- java - BeanUtils:将字符串日期格式的地图字段填充到日期属性
- java - Android grpc 执行失败
- django - 禁止更新 django 模型字段
- python - 在 for 循环中写入文本文件
- sql - 我们可以在 ColdFusion Query-of-Query 中使用“案例”吗