Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

Facing issue while verifying upload API in robot framework using python #275

Open
@SuperSonic-creator

Description

@SuperSonic-creator

I am very new to testing / developing. I am currently testing a REST API. In Postman I send a POST request by specifying parameters and uploading a file using form-data in the body. My request always succeeds. However, when I try to translate this into Robot Framework (using the Requests Library), I
I am posting my code below. I have been trying to resolve this issue for a while now. Any help in the right direction would be much appreciated!

Create Session alias ${uri}
${file_name}= Get Binary File Test.png
${headers}= Create Dictionary Accept=plain/text Content-Type=multipart/form-data
${data}= create dictionary asset=${file_name}
${resp}= post request alias /api/insertFile data=${file_name} headers=${headers}
Should Be Equal As Strings ${resp.status_code} 200
log to console ${resp.content}
log to console ${resp.headers}

It is giving me 200 always in server log also expected response is true but getting false every time. Although the same API is working perfectly in the Postman tool.

Attached server log

ServerLog

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions