Forum Discussion
Hi mjlamora .
I think your issue has already been addressed in this forum previously. See this post : https://community.smartbear.com/t5/ReadyAPI-Questions/Solution-Script-to-Cleanup-of-Custom-property-values-in-the/m-p/198108
Since that post, there is now indeed a way to exclude test suite & test case variables, so you should exclude those from that script.
You could, on top of that, also use a setup script (or equivalent load script) that loads in project properties from a file that is located in a git repo dedicated folder (which you can gitIgnore later). See below example where I have a readyApi.properties file in folder "datasource".
Content should be like this:
projectProperty1Name=projectProperty1Value
projectProperty2Name=projectProperty2Value
I got the original code form someone else, so I don't take credit for that. Together with that save script this should solve your question I believe.
setup script
def projectpath = project.path
project.setPropertyValue("projectpath", projectpath)
def testDataPath = project.path + "/datasource"
// Load properties from file. These properties can be used across the different environments.
def props = new Properties()
//replace the path with your file name below. use / instead of \ as path separator even on windows platform.
new File(testDataPath + File.separator + "readyApi.properties").withInputStream { s ->
props.load(s)
}
props.each {
project.setPropertyValue(it.key, it.value)
}
Related Content
- 5 years ago678
- 10 months agosanket2799