Forum Discussion
soapuitester999
10 years agoOccasional Contributor
Hi Team,
I faced the similar Problem and below is the workaround that I applied in my SoapUI. Possibly, you can try if wish to.
1) Create a empty property at Project level. E.g. Account Number
2) Add a Groovy Script where you usually add Property Transfer step. Remove Property Transfer step.
3) Make Sure you empty the Property everytime before and after the run. This is good practice.
//Trigger of Transfer property through Groovy
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def XmlUtils = new com.eviware.soapui.support.xml.XmlUtils()
def project = context.testCase.testSuite.project
//Empty Property Transfer before starting of the script
project.setPropertyValue("Account Number","")
//Define the Response Content that you wish to transfer (You can generate this by Right Click > Get Data > Select Request > Response > Value)
def accountNum = context.expand( '${rq_createAccount#Response#declare namespace
man=\'xxx:xx.xx.xxx.xxxxx.xxxxxxxxxx:1-0\'; //man:CreateAccountResponse[1]/Account[1]/@account_number}' )
//Transfer to Project level
project.setPropertyValue("Account Number", "$accountNum")
Below script worked for me and I am able to switch between 5 different env to run my test.
Hope the above helps
Prashant Nagrecha
I faced the similar Problem and below is the workaround that I applied in my SoapUI. Possibly, you can try if wish to.
1) Create a empty property at Project level. E.g. Account Number
2) Add a Groovy Script where you usually add Property Transfer step. Remove Property Transfer step.
3) Make Sure you empty the Property everytime before and after the run. This is good practice.
//Trigger of Transfer property through Groovy
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def XmlUtils = new com.eviware.soapui.support.xml.XmlUtils()
def project = context.testCase.testSuite.project
//Empty Property Transfer before starting of the script
project.setPropertyValue("Account Number","")
//Define the Response Content that you wish to transfer (You can generate this by Right Click > Get Data > Select Request > Response > Value)
def accountNum = context.expand( '${rq_createAccount#Response#declare namespace
man=\'xxx:xx.xx.xxx.xxxxx.xxxxxxxxxx:1-0\'; //man:CreateAccountResponse[1]/Account[1]/@account_number}' )
//Transfer to Project level
project.setPropertyValue("Account Number", "$accountNum")
Below script worked for me and I am able to switch between 5 different env to run my test.
Hope the above helps
Prashant Nagrecha
Related Content
- 2 years agoKellyWiegand
- 8 years agozsousa