Liberty_Informa
14 years agoRegular Contributor
custom Properties for Object
Hi,
We understand that script runs in a defined scope.
In the Project load script, we retrieve variable called config something like:
def config = new ConfigSlurper().parse(new File(projectPath + "/xyz.properties").toURL())
Can't we pass 'config' object to all test cases to read further from property file?
definitely project.setPropertyValue ("config", config) will not work, context.setProperty ("config", config) will work, but you get context as null in the test case level.
Anything better to work with this?
We understand that script runs in a defined scope.
In the Project load script, we retrieve variable called config something like:
def config = new ConfigSlurper().parse(new File(projectPath + "/xyz.properties").toURL())
Can't we pass 'config' object to all test cases to read further from property file?
definitely project.setPropertyValue ("config", config) will not work, context.setProperty ("config", config) will work, but you get context as null in the test case level.
Anything better to work with this?