<p>---Recover content start---</p>
The test case testcase can be defined in SOAPUI, but some use cases are dependent on the previous use case, and if a pure copy can lead to a bloated and poorly maintained use case, for example, there are two testcase:
1) createusertestcase: Test Create user, create user by sending SOAP message simultaneously need to verify correct value in database
2) Changuserinfotestcase: Test Modify user information, by sending a SOAP message to modify the user information, need to verify the pre-modification and modified user information
Changuserinfo before you have to create a user, a pure copy is definitely undesirable, because subsequent if the user's interface to create a slight change, you need to modify the request message in both Changuserinfotestcase and createusertestcase.
SOAPUI Provides step for run testcase in TestCase, you can invoke the specified testcase directly, but you need to pass the attributes in the previous testcase as follows:
1) Set the Return property in the called TestCase
TestRunner.testCase.setPropertyValue ("Property name", "Property value")
2) Add run TestCase in call TestCase to call TestCase
3) Get the property in the other test step in call TestCase
For example: To pass a created user ID to changuserinfotestcase in createusertestcase, the steps are as follows:
1) through groovy Script in Createusertestcase. Set the Return property:
TestRunner.testCase.setPropertyValue ("userid", Context.getproperty ("userid"))
2) in Changuserinfotestcase, add run testcase:runnewusertestcase to Createusertestcase and specify the UserID property as the input value
3) Get the user ID of execution createusertestcase in Changuserinfotestcase
def newuserproperties = TestRunner.testCase.getTestStepByName ("Runnewusertestcase");
Log.info (newuserproperties getpropertyvalue ("UserID"))
This article is from Wendy-qian's 51Testing Software Test blog: http://www.51testing.com/?15017055
http://www.blogjava.net/qileilove/archive/2014/01/16/409011.html<p>---recovery end---</p>
The test case testcase can be defined in SOAPUI, but some use cases are dependent on the previous use case, and if a pure copy can lead to a bloated and poorly maintained use case, for example, there are two testcase:
1) createusertestcase: Test Create user, create user by sending SOAP message simultaneously need to verify correct value in database
2) Changuserinfotestcase: Test Modify user information, by sending a SOAP message to modify the user information, need to verify the pre-modification and modified user information
Changuserinfo before you have to create a user, a pure copy is definitely undesirable, because subsequent if the user's interface to create a slight change, you need to modify the request message in both Changuserinfotestcase and createusertestcase.
SOAPUI Provides step for run testcase in TestCase, you can invoke the specified testcase directly, but you need to pass the attributes in the previous testcase as follows:
1) Set the Return property in the called TestCase
TestRunner.testCase.setPropertyValue ("Property name", "Property value")
2) Add run TestCase in call TestCase to call TestCase
3) Get the property in the other test step in call TestCase
For example: To pass a created user ID to changuserinfotestcase in createusertestcase, the steps are as follows:
1) through groovy Script in Createusertestcase. Set the Return property:
TestRunner.testCase.setPropertyValue ("userid", Context.getproperty ("userid"))
2) in Changuserinfotestcase, add run testcase:runnewusertestcase to Createusertestcase and specify the UserID property as the input value
3) Get the user ID of execution createusertestcase in Changuserinfotestcase
def newuserproperties = TestRunner.testCase.getTestStepByName ("Runnewusertestcase");
Log.info (newuserproperties getpropertyvalue ("UserID"))
This article is from Wendy-qian's 51Testing Software Test blog: http://www.51testing.com/?15017055
Http://www.blogjava.net/qileilove/archive/2014/01/16/409011.html
Passing parameters between multiple testcase in SOAPUI