-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I created functions using the requests library #246
Comments
I added the new one *** Settings *** *** Keywords *** #REQUEST FUNCTIONS GET Service Request POST Service Request PUT Service Request PATCH Service Request HEAD Service Request DELETE Service Request #RESPONSE FUNCTIONS Get Parameter Value Check Parameter Value is Null Check Parameter Value is Correct Check Return Code |
Look nice what about writing this as part of the library documentation? |
*** Settings *** *** Keywords *** #REQUEST FUNCTIONS Create Service Session With Token GET Service Request POST Service Request PUT Service Request PATCH Service Request HEAD Service Request DELETE Service Request #RESPONSE FUNCTIONS Get Parameter Value Check Parameter Value is Null Check Parameter Value is Correct Check Return Code |
Hello all,
I created some functions using the request library. So you can directly use this facility file in your projects.
`*** Settings ***
Library RequestsLibrary
Library HttpLibrary.HTTP
Library json
Resource ../variables/commonVariables.robot
*** Keywords ***
Create Service Session
Create Session session ${baseurl} verify=True
${headers} Create Dictionary Authorization=${apitoken} Content-Type=application/json
Set Global Variable ${headers}
GET Service Request
[Arguments] ${apiurl}
${response}= Get Request session ${apiurl} headers=${headers}
Set Global Variable ${response}
DELETE Service Request
[Arguments] ${apiurl}
${response}= Delete Request session ${apiurl}
Set Global Variable ${response}
Check Return Code
[Arguments] ${check_code}
Should Be Equal As Strings ${response.status_code} ${check_code}
Get Json Object
${json}= Json.Dumps ${response.json()}
Set Global Variable ${json}
Get Parameter Value
[Arguments] ${parameter} ${value}
Get Json Object
${parameter_value}= Get Json Value ${json} ${parameter}
Set Global Variable ${parameter_value}
Check Parameter Value is Null
[Arguments] ${parameter}
Get Parameter Value ${parameter} 0
Should Not Be Empty ${parameter_value}
Check Parameter Value is Correct
[Arguments] ${parameter} ${value}
Get Parameter Value ${parameter} ${value}
Should Be Equal ${parameter_value} ${value}
`
The text was updated successfully, but these errors were encountered: