Forum Discussion
deepesh_jain
14 years agoFrequent Contributor
You can access response fo the test step like below as well:
def groovyUtils1 = new GroovyUtils (context) ;
holder = groovyUtils1.getXmlHolder("Check Data_Positive_Scenario#Response") ;
def resp = holder.getDomNode("root node");
Populate the root node with the xpath. For example if your response structure is like:
<CheckResponse>
<Response1>
...
...
</Response1>
</CheckResponse>
Then your root node would be:
"\\ns1:CheckResponse"
where ns1 would be your name space.
This would give you the complete response.
def groovyUtils1 = new GroovyUtils (context) ;
holder = groovyUtils1.getXmlHolder("Check Data_Positive_Scenario#Response") ;
def resp = holder.getDomNode("root node");
Populate the root node with the xpath. For example if your response structure is like:
<CheckResponse>
<Response1>
...
...
</Response1>
</CheckResponse>
Then your root node would be:
"\\ns1:CheckResponse"
where ns1 would be your name space.
This would give you the complete response.