Forum Discussion
SmartBear_Suppo
Alumni
15 years agoIf I understand you correctly, you probably want to do something like this:
Good luck!
/Henrik
// loop the number of tag blocks - where r is the number of blocks which is determined by an XPath count (1-500 subtag blocks)
def masterArray = []
while( x < Integer.parseInt(r) ){
x++
// increment the block number to test each subtag block - this increments the Xpath [] to collect each block of data
testRunner.testCase.getTestStepByName('PropertiesXML').setPropertyValue("block number","${x}")
// Run the write to XML routine to write XML values to the properties file - this collects the data from the WS XML via XPath
testRunner.runTestStepByName("Write to XML")
// The Xpath values are stored in the properties file
a = testRunner.testCase.testSteps["PropertiesXML"].getPropertyValue("block number")
b = testRunner.testCase.testSteps["PropertiesXML"].getPropertyValue("code")
c = testRunner.testCase.testSteps["PropertiesXML"].getPropertyValue("eventDateTime")
d = testRunner.testCase.testSteps["PropertiesXML"].getPropertyValue("comment")
e = testRunner.testCase.testSteps["PropertiesXML"].getPropertyValue("transmissionStatus")
f = testRunner.testCase.testSteps["PropertiesXML"].getPropertyValue("transmissionVersion")
// The Xpath values are taken from the properties file to create a list
def myList = [a,b,c,d,e,f]
// Add the myList to the Master array in block x
masterArray.add( myList )
}
Good luck!
/Henrik