Registry / testing / robotframework-requests

robotframework-requests

JSON →
library0.9.7pypypi✓ verified 25d ago

robotframework-requests is a Robot Framework keyword library that wraps the popular Python Requests library, providing HTTP API testing functionalities. It is actively developed, with a stable `0.9.x` series and an ongoing `1.0aX` pre-release series introducing significant changes and new features.

pip install robotframework-requests
INSTALL
IMPORT
SIG · ROBOTFRAMEWORK-REQ
R
robotframework-requests
testingpythonv0.9.7
Install
2.5s avg
Import
Disk
26MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.9.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 27.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.5s · import 0.000s · 28MB
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RequestsLibrary
*** Settings *** Library RequestsLibrary
Robot Framework libraries are imported in the '*** Settings ***' section of a .robot file, not directly in Python code.

This quickstart demonstrates a basic GET request to a public API using sessionless keywords (available since v0.9). It retrieves a post, asserts the HTTP status code, and verifies a specific field in the JSON response.

*** Settings *** Library RequestsLibrary *** Test Cases *** Quick Get Request Example ${response}= GET https://jsonplaceholder.typicode.com/posts/1 Status Should Be 200 ${response} Should Be Equal As Strings 1 ${response.json()}[id] Log To Console Response Body: ${response.json()}
Debug
Known issues
breakingPython 2 support has been removed in `v1.0a10` and later versions. Users on Python 2 must either upgrade to Python 3 or stick to older `0.9.x` releases.
fix
Migrate your test environment to Python 3.6+.
affects: >= 1.0a10
breakingMany old keywords (e.g., `Get Request`, `Post Request`) are deprecated and will be removed in `v1.0.0` in favor of new keywords (e.g., `GET`, `POST`, `GET On Session`, `POST On Session`). The new keywords offer improved parameter alignment with the underlying `requests` library.
fix
Update your test cases to use the new keyword structure. For example, replace `Get Request` with `GET` or `GET On Session`.
affects: >= 0.8.0, < 1.0.0 (deprecated); >= 1.0.0 (removed)
gotchaKeywords like `GET On Session` or `POST On Session` implicitly fail if an error status code (e.g., 4xx, 5xx) is returned by default. To test for expected error responses (negative testing), you must explicitly set the `expected_status` parameter (e.g., `expected_status=any` or `expected_status=404`).
fix
Add `expected_status=any` or the specific expected error code to your HTTP request keywords when testing for non-2xx responses.
affects: >= 0.8.0
gotchaSensitive information, such as Authorization headers containing API keys or tokens, is logged by default. This can lead to security vulnerabilities if logs are not properly secured.
fix
Be aware of logging output. For sensitive data, consider configuring Robot Framework's logging levels, sanitizing outputs, or using external secret management where possible. `1.0a12` includes a fix for basic authentication leakage with specific keyword usage, but general logging awareness is still crucial.
affects: All versions
gotchaThere was an issue where file descriptors might not be closed correctly when using the `files` parameter, potentially leading to resource leaks. Additionally, uploading files as a list was broken in some `1.0aX` versions.
fix
Upgrade to `0.9.7` or later for file descriptor fixes. If using `1.0aX` pre-releases and uploading file lists, upgrade to `1.0a13` or later.
affects: < 0.9.7 (file descriptor issue); 1.0aX (list upload issue fixed in 1.0a13)
gotchaThe `auth` parameter for authentication can be inconsistent. `Create Session` may accept an iterable (e.g., list or tuple), but non-session keywords like `GET` typically expect a 2-length tuple specifically for HTTP Basic Authentication.
fix
When using the `auth` parameter directly in `GET` (or other sessionless requests), ensure it is provided as a 2-length tuple, e.g., `auth=('username', 'password')`.
affects: All versions
Upgrade
Version history
0.9.7latest on PyPI · released Apr 7, 2024
Audit
Dependencies
robotframeworkrequiredCore dependency for any Robot Framework library.
requestsrequiredThe underlying HTTP library that robotframework-requests wraps.
Agent activity
12 hits · last 30 days
node
10
Resources
robotframework-requests — pip install robotframework-requests · libregistry