At this point, it would be good to recap some of the things we learned about designing JSON objects and how to use them in the test methods. Let's take each point separately and discuss.
Casting JSON data to Java objects
JSON object
The JSON DataProvider designed earlier returns an array of objects. In simpler terms, we cast it at runtime to a JSONObject type when passed to the test methods. This JSONObject can then be used in any way the user wants—passing it to a Java object of a specific type, passing it to the Java builder class interface, assigning to local variables in the test method, and so on.
The main goal is to extract the data from the JSON file, convert it on the fly, and pass it into page object methods to...