Forum Discussion
shbgupta_2000
16 years agoOccasional Contributor
Hi,
Use groovy script and property transfer is slove your problem.
after first response and add the transfer properties (in source tab call namespace declare and the response xpath element and point to next test case request object in the target)
ex:
in the propert transfer and one variable
source textbox
select the source combo box as firsttestcase and property select the response
declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='.....'
//ns1:orders//ns1:orderno
target textbox
select the target select as secondtestcase name and property select the request
declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://abc.com' ';
//ns1:Cancelorders//ns1:ordernoNo
in the grovvy script
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder("testcasename#Response")
def orderno =holder.getNodeValue("//ns1:orders//ns1:orderNo") //we are excepting order no should be >0 number
if(status >0)
{
testRunner.runTestStepByName( "endTestcase") //create the grovovy script at the end of the test steps and named as 'endtestcase'
}
in the 'endtestcase ' testcase step (it's groovy script)
testRunner.cancel(properties.getPropertyValue("errorMessage"))
Thanks
SHBGupta
Use groovy script and property transfer is slove your problem.
after first response and add the transfer properties (in source tab call namespace declare and the response xpath element and point to next test case request object in the target)
ex:
in the propert transfer and one variable
source textbox
select the source combo box as firsttestcase and property select the response
declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='.....'
//ns1:orders//ns1:orderno
target textbox
select the target select as secondtestcase name and property select the request
declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://abc.com' ';
//ns1:Cancelorders//ns1:ordernoNo
in the grovvy script
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder("testcasename#Response")
def orderno =holder.getNodeValue("//ns1:orders//ns1:orderNo") //we are excepting order no should be >0 number
if(status >0)
{
testRunner.runTestStepByName( "endTestcase") //create the grovovy script at the end of the test steps and named as 'endtestcase'
}
in the 'endtestcase ' testcase step (it's groovy script)
testRunner.cancel(properties.getPropertyValue("errorMessage"))
Thanks
SHBGupta