Forum Discussion
nmrao
10 years agoCommunity Hero
Not sure if you got what it was already mentioned in the previous reply.
Keep all your properties in a file called myProject.properties(in this example, assuming that properties are to be set at project level).
Anyway, here is the code(can be used in load script for the project, so that automatically loads properties) that can do the same provided myProject.property is passed as system argument(-DmyProject.properties=<property file path>) while invoking soapui or testrunner.
def props = new Properties()
new File(System.getProperty("myProject.properties")).withInputStream {
stream -> props.load(stream)
}
props.each {
project.setPropertyValue(it.key,it.value)
}
rajnegi
8 years agoNew Member
Where to write this script. I want whenever my soapui project run, first it should load properties from external file.