How to Validate the Status Code of HTTP Response using RestAssured in Java? SDET Interview QnA | Automation Interview Question and Answer
Code:
public class StatusCode {
public static void main(String[] args) {
Response response = RestAssured
.get("https://reqres.in/api/users?page=2");
System.out.println(response.getStatusCode());
}
}
Visit - https://testautomationcentral.com/ for details tutorials and source code, Interview Preparation, Selenium WebDriver, TestNG, Java, Maven, Jenkins, GIT, and many more Tutorials