File I/O class
Another utility class that users will need to build is the file I/O class. This is a static Java class that contains all the methods for reading, writing, and deleting files, copying files, renaming files, accessing property files, finding files, setting file paths, extracting data, looking up messages, and many more. Storing all these similar methods in one central location for all CRUD operations (create, read, update, and delete) allows users to call these static methods from any page object or test class. Some of the more common methods will be outlined in this section.
Property files
Property files are common in testing, and are usually used for storing test environment data. There are various formats for property files, but they usually store data strings in key/value pairings. In order to read a property file in Java, there is a class called Properties
, which has various methods that load, list, set, or get properties. Here is an example of a property file pairing, with...