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 perform the test.
But what about dynamic data? The tests and suites being built need to remain platform and environment independent. As most development is now done in Agile rather than Waterfall, each scrum team works on their own branch ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access