Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Robot Framework - how to translate this to a REST request in code

Options
  • 28-02-2017 11:54am
    #1
    Registered Users Posts: 5,550 ✭✭✭


    Hey - see below.

    # Description URL Headers Data Expected Response
    1 Add Patient https://sw2-test.xxx.com/api/v1/test1/yyy "Accept:application/json
    Content-Type:application/json
    Authorization:authkey01
    " "{""patients"": [ {
    ""sponsor"": ""test1"",
    ""protocol"": ""Blue18-B18VP1"",
    ""site_number"": ""1001"",
    ""subject_number"": ""RT0001"",
    ""subject_status"": ""T"",
    ""randomization_date"": ""01Jan2017"",
    ""treatment_id"": ""B18VP2""
    } ]}" 201


    Im trying to make this into Robot code so expected response is 201. Here is my work in progress.

    *** Test Cases ***
    Add Patient
    [Tags] get
    Create Session sw2 https://sw2-test.xxx.com/api/v1/test1/yyy # TODO Variable to pass in
    &{headers}= Create Dictionary Content-Type=application/octet-stream Accept=application/octet-stream
    ${resp}= Get Request sw2
    Should Be Equal As Strings ${resp.status_code} 201

    Not sure how to do the rest of it. Im new to Robot so go easy :)


Comments

  • Registered Users Posts: 5,550 ✭✭✭veryangryman


    Bump in case any whizzes were away.

    While im on subject, are there any better resources out there to learn Robot than the couple at top of google search


Advertisement