How do I send Request in Robot Framework It Gives 500 server error

Viewed 186

//How do I send Request in Robot Framework It Gives 500 server error

//This is the request body that I want to send
{
    "destinationFaxNumber": "9546599326",
    "documentCount": 1
}

*** Variables ***
${base_Url}=    https://07du47r041.execute-api.us.com/dev/v1/outbound
*** Test Cases ***

Send Fax Request
    ${headers}=  create dictionary   Authorization=${Token}   Content-Type=application/json
    #${file_data}=   Get Binary File  D:TestCases/SendFax.json //commented
    
    ${body}=    create dictionary    destinationFaxNumber=9546599326   documentCount=1 
    create session  faxsession   ${base_Url}     headers=${headers}
    log to console  ${body} 
    ${response}=    Post On Session    faxsession   /fax  data=${body}   headers=${headers}

   However I'm getting below error

HTTP Error: 500 Server Error: Internal Server Error for url: https://07du47r041.execute-api.us.com/dev/v1/outbound/fax

1 Answers

If postman works and RF does not, the request payload is 99.99% at fault. Capture network traffic with succesful and failing requests and compare what is different.

For example, if you have access to linux box or any machine with netcat, start nc on some port and point the url from postman and rf into that NC socket and see the request differences right in the console of nc.

Related