JSON is a format of keeping your data in a customized way that allows you to fetch data from JSON files, dynamically, at run time as per requirement. For automating dynamic UI from JSON in Selenium, a synchronized mapping between Json Objects & UI objects is required. Data in JSON is stored as Key-Value pairs and through the index of a particular attribute in JSON, we can fetch the corresponding value. These fetched values from Json then can be used dynamically in your automation selenium test script.
Additionally, please refer to the below code to fetch data from JSON File(DummyJsonFile.json) and use it in your automation script:
High Level Code:
Note: Alternative way is to use Pseudo WebDriver elements and use in automation script.