robotframework-httpctrl is a library for Robot Framework that provides HTTP/HTTPS client and HTTP server services
Project description
HttpCtrl library for Robot Framework
RobotFramework-HttpCtrl is a library for Robot Framework that provides HTTP/HTTPS client and HTTP server services to make REST API testing easy.
Version: 0.1.0
License: GNU General Public License
Documentation: https://annoviko.github.io/robotframework-httpctrl/
Dependencies
Python version: >=3.4
Installation
Installation using pip3 tool:
$ pip3 install robotframework-httpctrl
Brief Overview of the Library Content
HttpCtrl contains following general libraries:
HttpCtrl.Client - provides API to work with HTTP/HTTPS client [link client documentation].
HttpCtrl.Server - provides API to work with HTTP server [link server documentation].
HttpCtrl.Json - provides API to work Json messages [link json documentation].
Examples
Send GET request to obtain origin IP address and check that is not empty:
*** Settings ***
Library HttpCtrl.Client
Library HttpCtrl.Json
*** Test Cases ***
Get Origin Address
Initialize Client www.httpbin.org
Send HTTP Request GET /ip
${response status}= Get Response Status
${response body}= Get Response Body
${expected status}= Convert To Integer 200
Should Be Equal ${response status} ${expected status}
${origin}= Get Json Value From String ${response body} origin
Should Not Be Empty ${origin}
In this example HTTP client sends POST request to HTTP server. HTTP server receives it and checks incoming request for correctness.
*** Settings ***
Library HttpCtrl.Client
Library HttpCtrl.Server
Test Setup Initialize HTTP Client And Server
Test Teardown Terminate HTTP Server
*** Test Cases ***
Receive And Reply To POST
${request body}= Set Variable { "message": "Hello!" }
Send HTTP Request Async POST /post ${request body}
Wait For Request
Reply By 200
${method}= Get Request Method
${url}= Get Request Url
${body}= Get Request Body
Should Be Equal ${method} POST
Should Be Equal ${url} /post
Should Be Equal ${body} ${request body}
*** Keywords ***
Initialize HTTP Client And Server
Initialize Client 127.0.0.1 8000
Start Server 127.0.0.1 8000
Terminate HTTP Server
Stop Server
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file robotframework-httpctrl-0.1.0.tar.gz
.
File metadata
- Download URL: robotframework-httpctrl-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3916def355f1f9536a142c35f00bef69de32a65f435dd4b1b645101ee277a456 |
|
MD5 | 7de071186087ea1d233a88332257e311 |
|
BLAKE2b-256 | 8246a0a03b1910b988560e2ed2757aa85e3bdceaf9b9a75e0d9907901906e733 |