I have a way to attach file as binary to ALM using REST API
URL = "https://some.almserver.com/qcbin/rest/domains/DOMAIN/projects/PROJECT/runs/<run-id>/attachments"
METHOD = "POST"
HEADERS = {
'cache-control': "no-cache",
"Slug": "some.html",
'Content-Type': "application/octet-stream"
}
def attach_to_run_step():
f = open("/path/to/some.html", "rb")
response = requests.post(URL, headers=HEADERS, cookies=cookies, data=f.read())
print(response.content)
I couldn't find any way to upload attachments which are in url format (from X website to ALM directly using REST) But from ALM UI, we have option to upload attachment using URL.
Expecting METHOD, HEADERS, Request payload to upload url to ALM.
You need to authenticate and get the ALM session before trying to do anything else.
Check out the Documentation for details.
Here is a sample code (sorry I'm not a Python guy, but it works):
Just replace
user
,password
and run-step ID with your own.P.S. We are developing commercial platform for integrating various test frameworks with ALM, which is called Agiletestware Bumblebee, so you might want to have a look at it.