- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经搜索了几天并试图自己解决这个问题,但没有成功。
我发现可以使用类似以下内容将文件附加到 QC Run(使用 Python 或 Ruby)(在 Rest 请求中发送):
内容示例:
headers = {'accept': 'application/xml', 'Content-Type': 'multipart/form-data; boundary=exampleboundary'}
--exampleboundary
Content-Disposition: form-data; name="filename"
example.txt
--exampleboundary
Content-Disposition: form-data; name="description"
Here is the text that describes example.txt
--exampleboundary
Content-Disposition: form-data; name="file"; filename="example.txt"
Content-Type: text/plain
ContentOfFile
--exampleboundary--
这确实有效,但(显然)仅适用于文本文件(.txt)。我确实需要上传一些图像,例如测试证据/屏幕截图。
我怎样才能实现这一目标?谁能帮我解决这个问题吗?
我发送的请求内容如下:
import requests
#login
response = requests.get("http://"+server+"/qcbin/authentication-point/authenticate", auth=(user,pwd))
# Get ALM token in dict format
token = response.cookies.get_dict()
requests.post(url, content, cookies=token, headers=headers_image)
谢谢。
最佳答案
引用巴尼的评论,我在这里留下了解决问题的答案。
def upload_result_file(self, run_id, report_file, token):
url = "http://%s/qcbin/rest/domains/%s/projects/%s/runs/%s/attachments" % (server, domain, project, run_id)
payload = open(report_file, 'rb')
headers_file = {}
headers_file['Content-Type'] = "application/octet-stream"
headers_file['slug'] = "test-results." + report_file[report_file.rfind(".")+1: ]
response = requests.post(url, headers=headers_file, data=payload, cookies=token)
if not (response.status_code == 200 or response.status_code == 201):
print "Attachment step failed!", response.text, response.url, response.status_code
return
来自: https://github.com/macroking/ALM-Integration/blob/master/ALM_Integration_Util.py
关于python - 如何使用 HP ALM REST API 在 QC 中将 IMAGE 作为运行附件上传,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45064144/
我在 Tensorflow 2.0-beta0 中使用 HParams Dashboard 使用超参数,如此处的建议 https://www.tensorflow.org/tensorboard/r2
我最近创建了一个新的恢复场景,我们希望将其添加到数百个现有的运行脚本中。 不幸的是,将其设置为包含在默认值中仅适用于新脚本创建,并且不会将其追溯添加到所有现有脚本中。 我已询问 HP 支持,他们建议您
我正在通过开放测试架构 API 与 Quality Center 交互。 我想确定链接到查找表的错误字段的允许值。 这些可通过标准前端的下拉菜单获得。 谢谢 编辑:更详细的解释 我们有一些字段只允许在
我已经安装了 HP UFT v12.01,当我尝试通过 HP UFT 连接到 HP ALM Quality Center v11.0 时,出现以下错误: 无法从服务器更新组件。无法托管 Spider
使用 HP UFT v11.53 补丁 5BHOManager.dll 没有注册,当然在我们的一些测试机器上也没有启用。 谁能告诉我 BHOManager.dll 的用途以及如果未注册、安装、启用等可
我已经安装了 HP UFT v12.01,当我尝试通过 HP UFT 连接到 HP ALM Quality Center v11.0 时,出现以下错误: 无法从服务器更新组件。无法托管 Spider
hierarchy 我有一个包含 img 对象的 ShootingEnemy 对象(它上面有一个 SpriteRenderer)。射击敌人可以用玩家的子弹射击敌人。我希望它在 HP 水平下降时变得越来
我是 HP Vertica 的新手。我阅读了 HP Vertica 的安装文档。该文档完全基于 *ix 环境。所以,我的问题是我们也可以在 Windows 上安装 HP Vertica 吗? 另一件事
惠普企业(HPE)警告说,其Aruba AirWave管理平台所使用的开源程序Sudo中的一个漏洞会允许任何无特权和未经认证的本地用户在含有漏洞的主机上获得root权限。 根据HPE最近的安全公告
我试图创建一个Powershell脚本来完全自动化UFT(HP的Unified Functional Testing 12.01)安装和配置过程。是否有一个注册表设置可以控制“允许其他HP产品运行测试
您好,我在实现 HP-35 型计算器的基本功能时遇到了一些麻烦我是初学者,在将代码放在一起时遇到了很多麻烦,基本功能是加法、减法、乘法和除法我需要帮助。 下面是我的主文件: /* * File:
我试图了解在 HP-UX 11.11 中运行的导致 SIGSEGV(11,段错误)的程序出了什么问题: (gdb) bt #0 0x737390e8 in _sigfillset+0x618 ()
这个问题可能过于特定于产品,但我想知道是否有人从 HP 质量中心导出错误跟踪数据。 HP 质量中心 (QC) 有一个老式的 COM API,但我宁愿使用 Web 服务甚至屏幕抓取工具将数据导出到 Ex
对于我的 Controller 中的大多数操作方法,HP fortify scan 给我一条消息作为Mass Assignment: Insecure Binder Configuration (AP
我有一个 LeanFT 项目,当我从 IDE 执行它时,它工作正常。我使用 maven-assemble-plugin 生成了一个 jar 文件。 org.apache.maven.plug
我正在通过 Hp Fortify 运行代码,并发现了一些路径操作问题。我了解它的上下文并尝试解决。 我没有遍历从数据库中查询某些路径值以存储输出文件(日志、导出数据等)的所有位置,而是尝试将其集中。因
根据 HP Fortify 文档,静态代码分析器首先将源代码翻译成中间格式,然后扫描翻译后的代码并生成漏洞报告。 它说可以使用以下 Ant 代码进行翻译: 这将调用您的“编译”目标,但强
我使用 Jersey 构建了一个 Rest 服务并将其部署在本地 Tomcat 6 中,它工作正常,但是当我部署到 Hp-nonstop(我相信 Tomcat 6)时它不会出现。你能帮我一下吗?我还尝
我正在使用 HP QC 来管理缺陷(刚刚开始)并且对各种缺陷状态类型有疑问.... 我们有: 新 - 新缺陷 打开 - ?? 活跃 - 正在调查缺陷 已修复 - 开发团队已发布修复 - 需要重新测试
我有一个很简单的问题,为什么这段代码的输出是这样的? 我正在使用 Dev-C++ 5.11 和 TDM-GCC 4.9.2 64 位 #include using namespace std; in
我是一名优秀的程序员,十分优秀!