[Tutorial] Building a modular API test framework

Tutorial

Nowadays more and more testers use GUI tools to do their API testing, which is a good thing, as these tools provide a low-level, yet powerful entry into the topic.

A programmatic approach to API testing is even more effective: The full potential of a programming language, combined with certain tools & libraries, provides nearly endless possibilities for testing.
One such library for Java is “REST Assured”. It simplifies testing of REST based services and can be used to verify and validate Rest APIs. While using it, you have all the possibilities of a full programming language at hand.

But there’s more to a good test framework than only a tool interacting with an interface of the application: Beyond the capabilities of REST Assured you also want to abstract away the complicated and repetitive things and you also want to manage test objects in a smart and time saving way.

In this tutorial, we will build a modular API test framework and some libraries that can be a blueprint for your similar context at work.
There will be plenty of hands-on exercises, to facilitate your learning and you gain your own experience in using these tools and libraries.

We will use Java, Maven, REST Assured, JUnit, Lombok and Jackson to build the framework.

Prerequisites:

Bring your laptop :)

Key Takeaways:

  • Develop a proficient understanding of REST Assured and its capabilities for API testing.
  • Create a modular API test framework that can be applied to similar contexts in a professional setting.
  • Enable participants to abstract complex and repetitive tasks, enhancing efficiency in API testing.
  • Cultivate the ability to model business objects within code for streamlined test interactions.
  • Implement low-effort test data generation techniques for more comprehensive API testing.