TestMace
0.0.1-beta.7
0.0.1-beta.7
  • Getting Started
  • Interface
    • The Menu
    • Interface Overview
    • Scratches
    • Node Types
    • Keyboard Shortcuts
  • Node Types
    • Project
    • Folder
    • RequestStep
    • Assertion
      • Compare
      • Contains
      • Script
      • XPath
    • Link
    • API description
      • ApiRootFolder
      • ApiFolder
      • ApiRoute
      • API Description Import
    • Broken
    • Script
  • Variables
    • User-Defined Variables
      • Static Variables
      • Dynamic Variables
    • Default Variables
    • Environment Variables
  • Working with the project
    • Cookie
    • Authorization
  • Settings
    • Proxy
  • Other features
    • Bulk Edit
    • Import & Export
      • Shared
      • cURL
      • Swagger
      • Postman
    • Default HTTP headers
Powered by GitBook
On this page
  • Installation
  • Interface Overview
  • Your First GET Request
  • POST Request and Assertion
  • Dynamic Variables
  • PUT Request
  • Verifying Changes
  • DELETE Request
  • DELETE Verifying
  • Summary
  • Video Instruction
  • Getting started code for a shared import
  • Download the Project

Was this helpful?

Getting Started

This guide will help you quickly get to know TestMace interface and its main features.

NextThe Menu

Last updated 5 years ago

Was this helpful?

In this guide we're going to test a back-end server running the following scenario for post records:

  • request all records from the server;

  • add a new record;

  • check if the record was added correctly;

  • update the record and check the update with a server response;

  • request the updated record from the server;

  • check if the record on the server is updated;

  • delete the record;

  • check if the record was deleted from the server.

You'll need about 10 min to do that after running the app.

Installation

Go to our site or use the following links to download TestMace:

  • Windows

  • Mac OS

  • Linux

Run the installer and follow the instructions. You will be prompted to choose an installation directory.

To install TestMace on Windows run the installer as an administrator.

Once the installation is complete, run the app. You'll see a new project.

Interface Overview

Your First GET Request

Note that all changes to the project are automatically saved in real-time.

Double click on the created request getPosts to open it and then run it with the Run button.

As you see, the request was successfully run, and you have a list of existing records in Response Area. Let's take a closer look at this window:

Request parameters

Here you can specify http headers and pass parameters to the request with the help of the autocomplete feature and variables.

Request type

  • 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

URL

The URL field supports autocompletion and using variables. We'll take advantage of these features later.

Make Request

Sending a request or a group of requests while running from the project root or a folder node.

Response area

A server response area. The Response Body tab contains parsed, JSON, and text representations of a response. On the tabs next to it you can see Response Headers and create or view existing Assertion nodes to make a request.

POST Request and Assertion

A new node can be created in three different ways:

  1. Create a Scratch by clicking on + and drag and drop it to the project later.

  2. Right-click on the parent node and choose Add node -> Request step.

  3. Click on the button Add project node-> Add node -> Request step.

Use any of these ways to create a node and name it createPost.

  1. Set POST as its Request type.

  2. Chose JSON on the response body tab and add {"title": "Testing post", "content": "Sendt via TestMace"}

  3. Click on the RUN button and send the request.

Now send the createPost request, and you'll see that the test was successful. The task is really easy. Have a look at the animation below:

Dynamic Variables

  1. Right-click on the Id value in the CreatePost node's response body.

  2. Choose Assign to variable.

  3. In a pop-up window choose the posts project directory as a node, enter the variable name (postId) and press OK.

${$dynamicVar.postId}

PUT Request

It's time we sent a PUT request. Let's access the previously created record using a dynamic variable ${$dynamicVar.postId} and update its title and content values.

  1. Set PUT as its request type.

  2. Body: {"title": "Testing post updated", "content": "Updated via TestMace"}

Verifying Changes

In some situations you might want to additionally verify changes in the record, because the server may give a successful response of PUT, but sending a GET request you receive the old version.

To do that create a GET request at the record's URL using a dynamic variable.

  1. Request type: GET.

DELETE Request

Our next step is deleting our record at the provided URL using a dynamic variable.

  1. Request type: DELETE.

DELETE Verifying

To ensure that the record was deleted from the server, create a GET request at that record's URL using a dynamic variable. We expect to get a 404 response from the server, and so we create an Assertion node:

  1. Request type: GET

    1. Actual value: ${$response.code}

    2. Operator: =

    3. Expected value: 404

Summary

In the end we've got a test set for our server that we can run in a scenario. Just go to posts and click RUN.

Video Instruction

Watch a video of the entire process of creating a scenario described in this guide.

Download the Project

Unzip in the TestMace projects directory.

To make your first request create a new tab by clicking on +. При этом в зоне You'll see a new Scratch 1 node in the Scratches Area. Insert this address in the URL field: . You can now test server response right from Scratches Area or add your scratch to the project. Rename the node to getPosts for convenience.

In your project create a node named posts and move the scratch getPosts from the Scratches Area to the Project Area.

Now let's add a new post record to the server, and to do that we need to create a new node.

Insert in the URL field.

You'll get a response telling you that the record has been successfully added, but we need to check if it was added correctly. And to do that we'll use the quickest way of creating nodes. We'll compare the sent data with the data received from the server.

In Response Area open the tab with the parsed response and right-click on the title value, that you passed in the request and choose Create Assertion -> Compare -> Equal. It'll create and open the node, and as you're not going to configure it, just close it. Create an Assertion node for the Content value in the same way.

To be able to interact with the newly added node you should pass its Id to all subsequent nodes. Define a dynamic variable postId and assign to it the Id value, received in the record after running CreatePost.

To access the variable use a $dynamicVar:

Create a node named updatePost.

URL:

Send the request and, just like we did with the POST request, create two nodes to compare sent and received title and content values.

Create a new node named getPost.

URL:

Send the request and create 2 nodes to compare title and content values.

Create a node named deletePost.

URL:

Create a new node named checkIfNodeExists

URL:

Send the request, open the Assertions and add a new node, by clicking ADD. Set the node data:

Getting started code for a import

https://client.testmace.com
https://download.testmace.com/TestMace.exe
https://download.testmace.com/TestMace.dmg
https://download.testmace.com/TestMace.AppImage
https://testmace-stage.herokuapp.com/posts
Folder
RequestStep
https://testmace-stage.herokuapp.com/posts
Assertion
Assertion
Request step
default variable
RequestStep
https://testmace-stage.herokuapp.com/posts/${$dynamicVar.postId}
Assertion
RequestStep
https://testmace-stage.herokuapp.com/posts/${$dynamicVar.postId}
Assertion
RequestStep
https://testmace-stage.herokuapp.com/posts/${$dynamicVar.postId}
RequestStep
https://testmace-stage.herokuapp.com/posts/${$dynamicVar.postId}
Assertion
shared
8KB
getting_started_shareCode.txt
Getting Started Share Code
7KB
TestMace_getting_started.zip
archive
Quick start project
Creating a GET request template
Creating a Folder node and GET request template moving
Running a GET request
Sending POST request and creating an Assertion node
Creating a dynamic variable
Creating a PUT request
Verifying changes using a GET request
DELETE request
Verifying if the record was deleted via the server response
Running a scenario