Issue
Im trying to pass a string parameter from jenkins into my selenium project as its a parameter that need to be updated a lot and some people using it arent familiar with changing the file in git every time it needs to be ran. However the parameter doesnt seem to be passing in at all. My jenkins setup is this
And my selenium setup is
private static String appID = prop.getProperty("appID");
with a properties file where appID is set.
I would like to override the value set in selenium when there is something entered the jenkins value but it doesnt seem to be working
Solution
The quick solution can be
private static String appID = System.getProperty("appID", prop.getProperty("appID"));
You also can start using QAF which has this feature. QAF properties configuration has many useful features to satisfy automation basic needs. You can provide property in multiple ways. For any property, value provided through system property has highest preference.
Answered By - user861594
Answer Checked By - Candace Johnson (JavaFixing Volunteer)