The JSONObject class

Once the data is extracted from the JSON file, it is available for use in the test methods. Users can cast the extracted data to a JSONObject of any type they desire to create. This allows them to access each field using a key/value pairing, and that data can be passed into test case methods that perform the actions on the screen.

Remember, when using the Selenium Page Object Model, each page object class contains all the methods that pertain to using the features on a specific screen, and those methods are called from within the test methods to vary data passed to them. This allows the test methods to be reused for multiple test scenarios, and keeps an abstract layer between the page object and the test classes.

The ...

Get Learn Selenium now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.