lszp
9 years agoNew Contributor
Reload properties from externalfile automatically
Hello all,
I'm doing some functionnal test using SoapUi. For some tests I need some properties which change dynamically. In order to update them on each test, a small program write an external properties file on my hardDisk with the new values. Then on soapUi properties test step, I load it using "Reload the current properties from the selected file" button.
My question is is there a way to automatically run the reload function, each time I start the testCases, before running the soap/rest requests?
Regards.
You should be able to load the properties from file using groovy script.
Below script will load the properties at test case level.
def props = new Properties() //replace the path with your file name below new File("/absolute/path/of/test.properties").withInputStream { s -> props.load(s) } props.each { context.testCase.setPropertyValue(it.key, it.value) }