Back to Course
Rest Assured

Json Path Introduction

What is JsonPath?

JsonPath is a query language (and the Rest Assured class that implements it) for navigating and extracting specific values from a JSON document, similar to how XPath works for XML.

Basic Syntax

JsonPath jp = new JsonPath(responseBody);
String name = jp.getString("data.first_name");
List<String> allIds = jp.getList("data.id");

Why Testers Use JsonPath

JsonPath lets a test navigate deeply nested JSON responses precisely — pulling out one specific field, or a whole list of values, without manually parsing the JSON string.

Ready to master real-world software testing?

Learn manual and automation testing hands-on with mentor-led sessions.

Explore Course