如何在SoapUI中的不同项目之间传递属性 [英] How to transfer properties between different projects in SoapUI

查看:9
本文介绍了如何在SoapUI中的不同项目之间传递属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是SoapUi新手,在以下方案中需要一些帮助:

我有两个项目,每个项目都有不同的关联的wsdl文件

项目1:
管理
->登录
->注销

项目2:
检索
->搜索

如何将属性(UserID、authToken)从登录测试用例中的Soap响应从项目1传输到项目2中‘Search’测试用例中的Soap请求?

我尝试添加了测试步骤‘Property Transfer’,但只返回Project1下的测试用例列表(例如‘Logout’),而不是项目2(搜索)下的测试用例?

推荐答案

可以使用Groovy脚本测试步骤:

//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);

这篇关于如何在SoapUI中的不同项目之间传递属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆