About the Course

This lesson introduces you to the course, including whom it's for and the prerequisites you need.

Welcome to the course

Welcome to API test automation in Java! This course contains all the required topics and details needed to learn API automation from scratch using Java. It will also help in preparing for interviews. There is a downloadable framework given in the last chapter, which can be used to start writing API automation tests for any module and also be extended for further customization.

Intended audience

This course is designed for test engineers and developers who want to learn or start their career in API test automation. It is designed for both beginner and intermediate developers.

Prerequisites

You don’t need any previous knowledge of test automation or APIs, but you should have basic knowledge of programming in Java. If you are new to the Java language, we suggest you go through Java basics first.

Sample Simulation

Press the RUN button and see the output

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.hamcrest.Matchers.equalTo;
import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import io.restassured.response.Response;
import io.restassured.RestAssured;
public class GETRequestTest {
private static Logger LOG = LoggerFactory.getLogger(GETRequestTest.class);
@Test
public void testGetAllStudentRecords() {
String url = "http://ezifyautomationlabs.com:6565/educative-rest/students";
/**
* Example 1 - GET all the existing student's record
*/
LOG.info("Step - 1 : Send GET Request");
Response response = RestAssured.given().get(url).andReturn();
LOG.info("Step - 2 : Print the JSON response body");
response.getBody().prettyPrint();
LOG.info("Step - 3 : Assert StatusCode = 200");
assertEquals(response.getStatusCode(), 200, "http status code");
LOG.info("Step - 4 : Verify that the response contains id = 101");
LOG.info("list of Student's Id " +response.getBody().jsonPath().getList("id"));
assertTrue(response.getBody().jsonPath().getList("id").contains(101));
}
}

The above code will be explained in the upcoming parts of the course. You will be able to execute and practise right there in the course.

Learning outcomes of the course

You will understand the basics of HTTP, client-server architecture, API and Web services.

You will learn about various HTTP methods, REST.

REST API automation using REST Assured library.

You will learn about SOAP and SOAP API automation.

You will understand integration test automation, integrating allure reports and manual testing of SOAP and REST APIs.

You can download a sample framework which can be further customized for your learning and project needs.


Since we are starting API test automation from scratch, there’s no need to worry if you have no prior experience working with APIs. So, without further ado, let’s get started with learning.