Krishan Chawla

Technical Lead

Software Engineer

Automation Expert

Tech Enthusiast

Rest Assured API Testing: Krishan Chawla’s Java Framework

  • Developer: Krishan Chawla
  • Date: 22 Dec 2020
  • Client: N/A
  • Category: Framework
API Automation Rest Assured Framework

Description

Explore the API Testing Rest Assured Java Framework, a comprehensive tool designed for automating API testing using Rest Assured in Java. This framework provides a structured approach to API testing, making it easier to write and maintain test cases for RESTful APIs.

Key Features
  • Modular Structure: The framework is built with a modular structure, allowing for easy organization of test cases, utilities, and configurations.
  • Configurable Environment: Supports multiple environments (e.g. development, testing, production) with configurable settings for endpoints and authentication.
  • Reusable Components: Provides reusable components for common API testing tasks, such as request and response validation, authentication, and error handling.
  • Reporting: Generates detailed test reports with information on test case results, execution time, and error messages, making it easy to identify and troubleshoot issues.
  • Integration with CI/CD: Integrates seamlessly with Continuous Integration / Continuous Development (CI/CD) pipelines, allowing for automated testing as part of the development workflow.
Technologies Used
  • Java
    100%
  • Selenium
    100%
  • Rest Assured
    100%
  • TestNG
    100%
Code Snippet:
/**
* Test Case: TC02_AddUserProfile
* Test Type: Positive
* Description: To verify that user is able to add new user in system through API
*
* @throws AutomationException
*/
@Test
public void TC02_AddUserProfile() throws AutomationException {

ExtentTestManager.startTest("Add User Profile", "To verify that user is able to add new users in system through API");

User userToCreate = new User(Randomizer.randomNumberWithoutZero(5));
User createdUser = (User) UserProfileService
.init()
.addUserProfiles(userToCreate)
.getResponse();

assertThat(createdUser).usingRecursiveComparison().ignoringFields("id").isEqualTo(userToCreate);

}
Usage Scenarios:
  • Regression Testing: Use the framework to automate regression testing of APIs to ensure that new code changes do not break existing functionality.
  • Integration Testing: Perform integration testing of APIs to verify that different components of the system works together as expected.
  • Load Testing: Utilize the framework to simulate high loads on APIs to test their performance and scalability.
Rest Assured API Framework Reporting Dashboard
Test Case Execution Report
Extent Report Dashboard
Extent Report Dashboard