Kevin
Kevin

Reputation: 41

Robot Framework

I am running Robot Framework 2.8.7 (Python 2.6.6 on win32) on my laptop and VM
Laptop: Windows 7 Enterprise
VM: Windows Embedded Standard
The post command works in Postmon for laptop and VM
however when I run a test case post command from Laptop, the Post works fine.
The VM test case Post command gives a response of 400. The 400 response is a bad request.
Both Laptop and VM have the same environment variable settings, same Post test case files.
This is the Post command:

#
${tmp}  Set Variable  Basic${SPACE}dmVyaXNlcTpWZVJpU2VRNTc0Lg==

${headers}=
...  Create Dictionary   Content-Type  application/json     Authorization  ${tmp}
#
# read the raw data
${file_data}=  Get Binary File  ${jFileName}
Log To Console    ${file_data}
Log        *Posting Data*: ${file_data}

${result}=  Post Request    webapiuri   /    data=${file_data}   headers=${headers}

Any idea why the VM robot framework response is a 400 (Bad request)?

Upvotes: 1

Views: 832

Answers (1)

Kevin
Kevin

Reputation: 41

Solved the problem by uninstalling a current version of robotframework-requests and installing an older version 0.3.8 robotframework-requests
For some reason, the newer version would change the way the json file was being
sent to the Tomcat. Now it works great! :)

pip uninstall robotframework-requests
pip install robotframework-requests-0.3.8.tar.gz

T

Upvotes: 3

Related Questions