How to transfer properties between different proje

2019-02-16 03:10发布

I am new to SoapUi and need some help with following scenario:

I have two project, each has different WSDL file associated with it

Project1:
Administration
->Login
->Logout

Project2:
Retrieval
->Search

How do I transfer properties (UserID, AuthToken) from soap response in Login testcase from project 1 to Soap request in 'Search' testcase in Project2?

I have tried by adding test step 'Property Transfer' but that only return list of testcases under Project1 (e.g. 'Logout') but not the testcase under Project2 (Search)?

标签: soapui
1条回答
Summer. ? 凉城
2楼-- · 2019-02-16 03:55

You can do it using groovy script test step:

//get test case from other project
project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName(project_name)
testSuite = project.getTestSuiteByName(suite_name);
testCase = testSuite.getTestCaseByName(testcase_name);

//set properties
testRunner.testCase.setPropertyValue(property_name, property_value);
testRunner.testCase.setPropertyValue(another_property_name, another_property_value);

// run test case
runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false);
查看更多
登录 后发表回答