I plan to create a global properties file for use across the application, and several properties files available only for specific classes and methods. Is there any particular industry standard for naming the property files?
A File Naming Convention (FNC) is a framework for naming your files in a way that describes what they contain and how they relate to other files. Developing an FNC is done through identifying the key elements of the project, the important differences and commonalities between your files.
. properties is a file extension for files mainly used in Java-related technologies to store the configurable parameters of an application. They can also be used for storing strings for Internationalization and localization; these are known as Property Resource Bundles.
What is the use of config.properties file in selenium. Properties are used to externalize the data which is configurable and if you put that data in your code (test script) you have to build the code each time you want to change the value of the property.
To my knowledge, there is no set rule.
The naming convention I go by is if it is a properties for a single class, I use {ClassName}.properties
, otherwise I use {WhatIsItUsedFor}.properties
, and occasionally if it's for a single application, {ApplicationName}.properties
. I have a preference for CamelCase; others prefer lowercase.
For the names of properties themselves, if granularity is possible, I use something like
{ClassName}.{MethodNameIfNeeded}.{IntendedVariable}={value}
Do realize the more property files you have, the more potential maintenance issues you create. Some are better off consolidating to a single properties file, using the property/value naming convention (above) to single-out any classes requiring their own configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With