The documentation https://docs.getxray.app/display/XRAY/Test+Runs+-+REST#TestRunsREST-ExecutionEvidence provides how to attach a image. How to upload a PDF for the same?
I'm not 100% certain on this, but looking at the sample POST from the link you provided, perhaps you could try changing from:
"filename"
:
"image21.jpg"
,
"contentType"
:
"image/jpeg"
to something like this:
"filename"
:
"sample.pdf"
,
"contentType"
:
"application/pdf"
I am trying to do the same using below JSON body , however I am facing an error :
{
"status": "FAIL",
"comment":"{ErrorLogs}",
"evidences":{
"add":[{
"data":"encodedStringFile", # this file holds the encoded string
"filename": "Summary.pdf",
"contentType": "application/pdf"
}]
}
}
Error:
Value does not resolve to a primitive type: com.provar.core.model.base.java.InvalidExpressionValueImplCalling a Web Service. Connection Name: AuthXray, target: rest:untyped?method=POST&bodyStyle=JSONConnecting to website.
Neither the Body nor Attachments/Parts were suppliedReading response. Content Type: text/html; charset=us-ascii, Encoding: nullThe REST response could not be read. Reason: Server returned HTTP response code: 411 for
Error:
Length Required
HTTP Error 411. The request must be chunked or have a content length.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.