Please guide how to attach/upload file(pdf) through rest API step in automation test flow
Please guide how to attach/upload file(pdf) through rest API step in automation test flow
DEVTEST has a Webservice Execution XML step, in which you can send an attachment as part of the request. You can do this in the Webservice Execution XML-->Attachments tab
Hope this helps.
Hi Shiney, Thanks for the reply, I think that step is applicable only for SOAP request but In this case I will need to use REST API URL with attachment. The same working in postman but trying to find solution wiht Devtest
The Web Service Call step is primarily intended for SOAP request but the payload content is completely free for you to choose, so whether or not you put a Soap:Envelope in there is up to you, you can just as well put a JSON structure.
One restriction it only does a POST. So, if your requirement is to do a POST to a REST API URL you can still use this step and its ability to attach a file.
Cheers,
Danny
Can you try this:
Add a MIME step,
Parameter : inventoryFile
File : {{filepath}}
MimeType:application/octet-stream
Then
In the HTTP step : add the POST Parameter
inventoryFile {{fileName}}