-
Notifications
You must be signed in to change notification settings - Fork 50
/
recipe091_working_with_requests_library.robot
27 lines (25 loc) · 1.25 KB
/
recipe091_working_with_requests_library.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
*** Settings ***
Documentation PROBLEM:
... You want to send a simple HTTP request using Requests library.
... DISCUSSION:
... This recipe demonstrates using keywords from Collections standard library.
... This recipe also demonstrates installing and using an external library.
... This recipe has the following external dependencies:
... $ pip install -U requests
... $ pip install -U robotframework-requests
Library Collections
Library RequestsLibrary
Force Tags py3.8 py3.9 py3.10
*** Variables ***
${recipe} Recipe 9.1 Working With Requests Library
${level} Intermediate
${category} External Library: RequestsLibrary
*** Test Cases ***
Get Request
Create Session github https://api.github.com
${response} = GET On Session github /users/adrianyorke
Log ${response.json()}
Should Be Equal As Strings ${response.status_code} 200
Dictionary Should Not Contain Value ${response.json()} The Black Knight
Dictionary Should Contain Value ${response.json()} Adrian Yorke
Dictionary Should Contain Value ${response.json()} Helsinki, Finland