RequestStep
Last updated
Was this helpful?
Last updated
Was this helpful?
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 or node and choose Add node -> RequestStep.
This is how a RequestStep node looks like in the project tree:
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.
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.
‌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;
Other - configures other request parameters.
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:
value is added to the HTTP headers list.
File - to send a file content in the request body.
Response Configuration 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:
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.
File Representation
A RequestStep node is a folder with the node name, containing the index.yml file with the following format:
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 node status: gray - if the node hasn't been run yet, green - if after running the node either doesn't exist or was successfully run, red - if the node was run unsuccessfully (some tests were failed).
the node. Note that the link with information about the node will be created in the clipboard.
The button for
Authorization - configures ;
The Headers and Query parameters tabs have similar interfaces - they are both tables with and row disabling options. Moreover, HTTP headers can be set .
JSON - to send JSON data. You can use the editor with JSON syntax highlighting and the support to edit the data. When sending a request a Content-Type
header with the application/json
Form data - to edit multipart/form-data
forms. It is a table with 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 option.
XML - to send XML data. You can use the editor with XML syntax highlighting and the 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 support to edit the data. When sending a request a Content-Type
header with text/plain
value is added to the HTTP headers list.
Let's send a request to the url and look at the response area:
Parsed - a tree form of the response. Each tree element has a context menu, so that you could create nodes and work with .
Assertions - a list of assertions that a child node has.