RequestStep
Last updated
Last updated
A RequestStep node is used for sending HTTP requests. TestMace allows to configure a request and use it as a single request or as a part of a scenario.
To create a RequestStep node right-click on a Folder or Project node and choose Add node -> RequestStep.
This is how a RequestStep node looks like in the project tree:
Let's discuss its features in more detail. The color of the top left circle signifies an HTTP request status: gray - if the request hasn't been sent yet, green - if the HTTP code is successful (e. g. 200, 201, etc), red - if the HTTP code is unsuccessful (e. g. 404, 500, etc). The sheet icon color signifies a child Assertion node status: gray - if the node hasn't been run yet, green - if after running the Assertion node either doesn't exist or was successfully run, red - if the Assertion node was run unsuccessfully (some tests were failed).
There are several actions you can do with this node type:
Add node. Click on it to add a child node. You can choose a node type in the submenu.
Rename. Change the node name.
Duplicate. Make a copy of the node. The new node will be named NodeName [Copy [number]].
Remove node. Use it to delete the node.
Run. Run the node.
Share the node. Note that the link with information about the node will be created in the clipboard.
Show in explorer. Open the folder with the node in the file manager.
RequestStep Node Tab
After you create a RequestStep node (or double click on it) you'll see the RequestStep node tab. It looks like this:
Let's discuss every interface part in detail.
The top area of the tab looks like this:
In the screenshot you can see the following parts of the tab:
Request method. There are several methods you can choose from:
GET — get a resource
POST — create a resource
PUT — update a resource
DELETE — delete a resource
PATCH — make some changes to a resource
OPTIONS — specify resource connection parameters
The URL field.
The Run button.
The button for editing variables
You can see the edit panel for headers, query parameters, authorization and request body down below. This is the panel for POST requests:
The panel has the following tabs:
Headers - edits an HTTP headers list;
Query parameters - edits a query parameters list;
Body - configures a request body;
Authorization - configures authorizations;
Other - configures other request parameters.
The Headers and Query parameters tabs have similar interfaces - they are both tables with bulk editing and row disabling options. Moreover, HTTP headers can be set by default.
The Other tab has the following interface:
You can set the Requires SSL certificates be valid parameter. It is Inherit by default, which means that the value of the parent node is inherited. If this parameter of the parent node is Inherit, the parameter is disabled. You can choose from:
Yes
No
Inherit
Now look at the Body tab:
You can choose your body type from a dropdown menu:
JSON - to send JSON data. You can use the editor with JSON syntax highlighting and the variables mechanism support to edit the data. When sending a request a Content-Type
header with the application/json
value is added to the HTTP headers list.
Form data - to edit multipart/form-data
forms. It is a table with bulk edit option. The table rows may contain either plain strings or file links as their values.
Form URL encoded - to edit application/x-www-form-urlencoded
forms. It is a table with bulk edit option.
File - to send a file content in the request body.
XML - to send XML data. You can use the editor with XML syntax highlighting and the variables mechanism support to edit the data. When sending a request a Content-Type
header with application/xml
value is added to the HTTP headers list.
Text - to send text data. You can use the editor with the variables mechanism support to edit the data. When sending a request a Content-Type
header with text/plain
value is added to the HTTP headers list.
Response Configuration Area
Let's send a request to the https://testmace-stage.herokuapp.com/posts url and look at the response area:
You can see short info about the response at the top of the area: a successful or unsuccessful response code, time and size.
There are the following tabs at the bottom of the response area:
Response body - contains the response body in different formats, such as:
Parsed - a tree form of the response. Each tree element has a context menu, so that you could create Assertion nodes and work with dynamic variables.
JSON - JSON syntax highlighting of the response body. It is available only if you have a JSON response body.
XML - XML syntax highlighting of the response body. It is available only if you have an XML response body.
HTML - HTML syntax highlighting of the response body. It is shown if the response body is an HTML page.
Text - plain text with no highlighting.
Preview - a rendered response body version. It is shown if the response body is an HTML page.
Response headers - a response HTTP headers list.
Assertions - a list of assertions that a child Assertion node has.
File Representation
A RequestStep node is a folder with the node name, containing the index.yml file with the following format: