Create your own REST testing application

This time i want show you how to create your own REST testing application. For this demonstration i use Python, Tkinter and some Python libraries. At the end of this tutorial you can extend the application with more features like “show headers”, “store requests/responses”, “run automatically” and so on.

Preparation

  • install Python > 2.7 (Tkinter included)
  • install Requests: HTTP for Humans
  • install Python Data Validation for Humans

Example

Run application

The application should look like:

RESTme Application

Create your own fake-data generator application

In this episode i want to show you, how easy it is to create a fake-data generator application.

Why?

  1. to get inspired
  2. if you need such tool behind restricted areas (without internet)
  3. software testers need a lot of fake-data

Required

  • Python > 2.7
  • Python Faker package installed

Example Application Code

Run Fake-Data Application

Now it`s on you to improve this tiny application! As example you could add file and/or database export, add more functionality or just improve the GUI.

Create information gathering test application

It is time again for an extensive tutorial. This time, a tiny test application for passive and active information gathering. After the instruction you are welcome to improve the application with more features! Okay let’s start…

What should it do?

The security tester selects a information gathering method first. As second step the testers insert the URL or IP in a testfield and press a button. The result should printed out in a text area. The GUI should look like this:

Sensei Mockup

How it is implemented?

The prefered language is Python 2.7. So it is portable to different OS and for the most of methods are already packages available. The GUI is done with Tkinter. Tkinter provides all objects which are needed as widgets and ranges for this scope out completely. The file and folder structure look like:

File content

Files in root directory:

Files in essential:

Files in gathering:

That was it. The result looks like this:

Sensei

Improve it with your ideas!

Create your own test application

A lot of software testers do have no or less development skills. They also have less skills to use commandline tools and need GUI applications. In addition, the test applications for the respective claims should be easy to use. This guide will show you how to easily deploy software testers the needed test tools. This is just an example, please feel free to expand it!

Precondition

Let`s go

After create a new PyCharm project (with virtualenv), create 2 new empty files (requirements.txt, ShowHeaders.py) and import a icon. You can found icons (*.icns) on iconarchive for free.

application project files

Open the “requirements.txt” file and add Requests library.

Open the “ShowHeader.py” and add the following content.

For first test, run the application. If there are no issues – open the PyCharm terminal and run the following command.

Now you should see the generated file “setup.py” in the Project. Open the file and add the icon. The content should look like this:

Now execute the following command to build, for first test.

After some messages in terminal, your Project should show 2 new folders (build, dist). The alias mode (-A / –alias) instructs py2app to build an application, but it is not portable to other machines! You can open the Application in Finder or from terminal for your tests. If there are changes, just run the build-command again.

If everything is fine and your Application is ready for ship, run the following command.

Again the Application can be found on folder “dist”. The result should look like this:

example application

Have fun and be creative! Too ship the test application for Windows users, look at py2exe.