Keeping comstants in java file not in property file | Selenium Forum
M
Posted on 27/12/2016
Hi Ashish,

I was going through mod 23 POM with pageFactory.
Here you have created a FBConstants.java file to keep the constanst like loacators, chrome.exe file path and extent report file path and so on.
i just want to know why don't we use here property file for the same.
what are the benifits of keeping constants in java file rather then property file.

M
Replied on 27/12/2016

you can do it in the properties file. there is no difference really, except in properties files when you make a change you don't have to recompile the code, and in constant.java you have recompile every time.