Setting up Restassured Project
Steps
- Create a Maven project in Eclipse.
- Add the Rest Assured and TestNG dependencies to
pom.xml. - Create a test class under
src/test/java. - Write a basic Rest Assured test and run it to confirm the setup works.
Verifying the Setup
@Test
public void setupWorks() {
given().when().get("https://reqres.in/api/users/2")
.then().statusCode(200);
}
If this test passes, the project is correctly configured and ready for further API automation work.
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.
.png)