In the preceding example, we extracted the username, password, and error message data from the JSON data file. But what if the username and password need to change dynamically based on the test environment being used? Would we really want to hardcode in the username and password for a test? What if the error message is used in 10 other places in the application? Would we really want to change that test message data 10 times if the message is changed in the application?
The answer is simple: probably not! So, in this section, let's start by talking about using property files to store confirmation and exception messages.