Rest Assured API Automation 1737266358
Rest Assured API Automation 1737266358
Automation Demo
Script with Rest
Assured in Just
15 Minutes
Create Maven Project and Add Dependency
• In this section, you will set up a Maven project to manage dependencies. Open your
preferred IDE and create a new Maven project. Add the Rest Assured & TestNG
dependency to your pom.xml file.
import io.restassured.RestAssured;
import io.restassured.response.Response;
import org.testng.annotations.Test;
@Test
public void sendGETRequest() {
// Specify the base URI
RestAssured.baseURI = "https://reqres.in/api";
@Test
public void validateStatusCode() {
// ... (previous code)
@Test
public void validateResponseBody() {
// ... (previous code)
@Test
public void sendGETRequestWithHeaders() {
// ... (previous code)