Numino REST API Java Test Automation Framework

Overview

In today’s times, there are multiple REST API automation frameworks available. ROBOT, CUCUMBER, TestNG, JMeter, apigee, Postman, etc. Each such framework attempts to patternize and simplify test creation of test automation scripts and minimize efforts required to achieve test automation. Existing test automation frameworks provide great efficiencies in writing repetitive tests at scale. All of these frameworks are low level frameworks. Such frameworks are open ended and not prescriptive on end to end test automation scenarios as well as manageability aspects like

Additionally, the choice of test automation framework typically depends on the following factors related to the Product team and Organization.

Many of Numino’s enterprise clients have a preference for the Java stack and ecosystem for building high performance products and microservice based architectures. Top talent and experienced Java developers look for the convenience of a framework as well as the flexibility of Java and custom test automation scripts, to be able to automate tests as per the testing philosophy they believe in. 

Numino’s software product architects designed Numino’s REST API Test Automation framework keeping in mind the following goals

Project Info

Category

Test Automation

Client

Numino

Tags

Product Features

Adoption
Adoption

Automation coders could create test cases by simply writing JSON files. These files included test data, API calls, and validation steps, making it easy to review and maintain test cases.



Independent Test Execution
Independent Test Execution
The framework ensured that tests could be run independently and in parallel, reducing dependencies and improving efficiency. The test project can also be seamlessly integrated with other Java projects, allowing tests to be executed from within these projects, providing a unified testing environment
Database Integration
Database Integration
The framework supports the inclusion of SQL queries within the test cases to validate the results directly against the API output, ensuring data integrity and consistency.
Extensible
Extensible

For more complex scenarios, coders could write custom test cases using Core Java and the framework's annotations.


The scope of the framework is focused specifically on API testing, offering robust support for REST API endpoints but intentionally excluding features like load testing or full integration testing to maintain simplicity and focus.

Results​

The framework reduced the time required to create and maintain test cases by 50%, significantly accelerating the API testing process.

The reduced skill requirements allowed for quicker onboarding of new team members, cutting training costs by 30%.

The ability to run independent test cases led to a 20% increase in test coverage, improving the overall quality of the web application.

This structured approach to test automation, combined with the flexibility and simplicity offered by the framework, ensures that REST API testing is both efficient and effective, catering to the specific needs of the client while maintaining a low barrier to entry for automation coders.

Technology Stack

Programming Languages

Test Automation Tools

Solution

Built using Core Java, the framework leverages 

 

      a) The power of Rest-Assured for executing test cases and 

      b) TestNG for managing assertions within these tests.

 

Steps of the setup include –

<span class="mil-accent">01</span> Modular Structure
01 Modular Structure

  • The framework allows the creation of modules within the project, with each module containing its own set of test cases. This modular approach helps in organizing and managing test cases efficiently.

<span class="mil-accent">02</span> Setup and Cleanup Scripts
02 Setup and Cleanup Scripts

  • For each module, setup scripts are used to prepare the required data before running the tests, and cleanup scripts are used to tear down and clean up the data after the tests are completed.
  • Annotations such as @SetupScript and @CleanUpScript can be used to specify script files containing SQL statements to be run before and after the test cases for the API.
  • Swagger documentation is provided to outline the supported fields within the JSON format, enhancing clarity and ease of use.

<span class="mil-accent">03</span> Test Case Execution
03 Test Case Execution

  • Users can set up as many test cases as needed within each module, providing flexibility and scalability in test coverage.
  • The framework supports essential features like authentication that can be setup as prerequisites.
  • This ensures that each test case runs in a controlled and isolated environment.

<span class="mil-accent">04</span> Display Results
04 Display Results

  • Test cases or entire modules can be executed directly from the command line.
  • The command line interface not only facilitates easy execution but also displays the test results immediately after the tests are run, providing quick feedback on the test outcomes.
  • The results of each iteration can be saved in Json format for any kind of analysis.

This structured approach to test automation, combined with the flexibility and simplicity offered by the framework, ensures that REST API testing is both efficient and effective, catering to the specific needs of the client while maintaining a low barrier to entry for automation coders.

Product Screenshots

Conclusion

The framework has received praises from clients for its simplicity and effectiveness.



It provides flexibility and supports customisation over the other available platforms.



The framework is expected to be further enhanced with additional features, such as integration with other testing tools and expanded support for different types of APIs.​

This structured approach to test automation, combined with the flexibility and simplicity offered by the framework, ensures that REST API testing is both efficient and effective, catering to the specific needs of the client while maintaining a low barrier to entry for automation coders.