Forum Discussion
Intermountain_H_3
16 years agoContributor
I found this to work:
Using the request xmlholder,
def holder = groovyUtils.getXmlHolder( "#Request" )
I get the xml nodes in question
def phoneNode = holder.getDomNode('//pat:PersonSearchCriteria[1]/pat:PhoneNumber[1]')
def acNode = holder.getDomNode( '//pat:PersonSearchCriteria[1]/pat:AreaCode[1]' )
I then set the values for the 'Value' of each node
phoneNode.getFirstChild().setNodeValue(srchPhone)
acNode.getFirstChild().setNodeValue(srchAC)
I then get the actual test case Step of where to store the request
def dsStep = testRunner.testCase.getTestStepByName('')
And store my modified xml in that step's Request property.
dsStep.setPropertyValue('Request', holder.getXml())
I had to experiment a bit to get the getFirstChild() portion.
I also determined that a Response property appears to be read only.
Hope this helps.
Using the request xmlholder,
def holder = groovyUtils.getXmlHolder( "
I get the xml nodes in question
def phoneNode = holder.getDomNode('//pat:PersonSearchCriteria[1]/pat:PhoneNumber[1]')
def acNode = holder.getDomNode( '//pat:PersonSearchCriteria[1]/pat:AreaCode[1]' )
I then set the values for the 'Value' of each node
phoneNode.getFirstChild().setNodeValue(srchPhone)
acNode.getFirstChild().setNodeValue(srchAC)
I then get the actual test case Step of where to store the request
def dsStep = testRunner.testCase.getTestStepByName('
And store my modified xml in that step's Request property.
dsStep.setPropertyValue('Request', holder.getXml())
I had to experiment a bit to get the getFirstChild() portion.
I also determined that a Response property appears to be read only.
Hope this helps.