0

I am trying add screenshot with log in reportportal but getting error message when trying to do so.

{
    "responses": [
        {"message": "ReportPortalException: Binary data cannot be saved. There is no request part or file with name screenshot",

Request payload containing the post details. Attached screenshot of postman is describing form data details

[
{"file": {
"name": "screenshot",
"contentType" : "image/jpeg"
},
"item_id": "5dca6e8fb9d8210001df81df",
"level": "Log info",
"message": "Result=Failed",
"time": "2019-10-23T21:27:33.280Z"}
]

Postman post image

Screenshot should attach with log in reportPortal

biruk1230
  • 3,042
  • 4
  • 16
  • 29

1 Answers1

0

Notice that ReportPortal expects you to send multipart request where the first part is json body and second one is file itself. Moreover, filename from binary part should be specified in json part. Here you can find some details. https://reportportal.io/docs/Logging-Integration%3Emultipart-logging-request-example

In your example, you send 'json_request_part' as json file which is not json body (not a file) that ReportPortal expects to see

It looks like starting from latest versions Postman does support this: Tool for sending multipart/form-data request

avarabyeu
  • 693
  • 3
  • 13