Passing parameters between multiple testcase in SOAPUI

Source: Internet
Author: User
Tags soapui groovy script

<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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.