Forum Discussion
mjchichester
15 years agoNew Contributor
The simple option could be to use the .INI style .prop files that can be automatically loaded into Properties upon TestStep run.
For a slightly more sophisticated solution, do some old-school name concatenation.
Sample of Servers Properties.prop
Snippet of initialization Groovy Script
Subsequent Property Transfer steps can all be used to set the following Test Request steps to use the setupUserName, setupPassword and setupPrefix Properties.
For a slightly more sophisticated solution, do some old-school name concatenation.
Sample of Servers Properties.prop
setupPrefix=sb
sbUserName=sb_user
sbPassword=sb_pass
sbEndpoint=http://sb/ws/
dgUserName=dg_user
dgPassword=dg_pass
dgEndpoint=http://dg/ws/
Snippet of initialization Groovy Script
def propServers = testRunner.testCase.getTestStepByName('Server Properties')
def propSetup = testRunner.testCase.getTestStepByName('TestSetup')
def setPrefix = propServers.getPropertyValue('setupPrefix')
(['UserName','Password','Endpoint']).each { item ->
def setupName = 'setup' + item
def getName = setPrefix + item
def getItem = propServers.getPropertyValue(getName)
propSetup.setPropertyValue(setupName, getItem)
}Subsequent Property Transfer steps can all be used to set the following Test Request steps to use the setupUserName, setupPassword and setupPrefix Properties.