I have searched for days and trying to solve the problem by myself, unsuccessfully.
I found that is possible to attach files to QC Run (using Python or Ruby) with something like this (send it in a Rest Request):
Content example:
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--
This really works but (apparently) only for text files (.txt). I really need to upload some images like test evidences/screenshots.
How can I achieve that? Can anyone help me to solve this problem?
I am sending the request content like this:
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)
Thank you.