I currently have a .properties file for storing settings related to the framework. Example:
default.auth.url=http://someserver-at008:8080/ default.screenshots=false default.dumpHTML=false
And I wrote a class to extract these values, and here is the method of this class.
public static String getResourceAsStream(String defaultProp) { String defaultPropValue = null;
Throughout the application, I use a method similar to the one below to pinpoint the required property:
public String getBrowserDefaultCommand() { String bcmd = SeleniumDefaultProperties.getResourceAsStream("default.browser.command"); if(bcmd.equals("")) handleMissingConfigProperties(SeleniumDefaultProperties.getResourceAsStream("default.browser.command")); return bcmd; }
But I did not decide to do this and use Ant and pass the parameter instead of using it from the .properties file.
I was wondering how to pass the value to the Java method using Ant. None of these classes have core methods and will not have any core. Because of this, I could not use the properties of the java system.
source share