Forum Discussion
AnandKiran
15 years agoFrequent Contributor
Hi anusooya.
In your scenario try the below following , First you need to have a Initialize Request step with the dummy XML.
Name the below XML as "Initialize"
?
?
?
?
?
?
// get request property
request1 = groovyUtils.getXmlHolder("Initialize#Request")
def actualXML= request1.xml
// set request property
request5 = testRunner.testCase.getTestStepByName( "AddCalcList" )
request5.getProperty("request").setValue(actualXML)
Now you can map your input values from your CSV file, but still your request XML looks incomplete because your XML may have few empty tags after the Input values are mapped.
For that you need to write groovy script to remove the empty tags from your actual Request XML.
please let me know if you are not clear with my solution.
Regards
Anand.
In your scenario try the below following , First you need to have a Initialize Request step with the dummy XML.
Name the below XML as "Initialize"
?
?
?
?
?
?
// get request property
request1 = groovyUtils.getXmlHolder("Initialize#Request")
def actualXML= request1.xml
// set request property
request5 = testRunner.testCase.getTestStepByName( "AddCalcList" )
request5.getProperty("request").setValue(actualXML)
Now you can map your input values from your CSV file, but still your request XML looks incomplete because your XML may have few empty tags after the Input values are mapped.
For that you need to write groovy script to remove the empty tags from your actual Request XML.
please let me know if you are not clear with my solution.
Regards
Anand.