Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

How do you use a REST Assured jsonPath to find all employee IDs between 15 and 300?

Category: Rest Assured

Response employeesResponse = RestAssured.given().request(Method.GET, “/all”);

JsonPath jsonPathObj = employeesResponse.jsonPath();

//get all employees id between 15 and 300

List employees = jsonPathObj.get(“company.employee

            .findAll { employee -> employee.id >= 15 && employee.id <= 300 }");

Leave a Reply

Your email address will not be published. Required fields are marked *