3
A
回答
1
将每个复制/粘贴到一个新请求中,然后右键单击每个请求并将它们添加到您的测试用例中。
1
或者在请求视图中打开上下文菜单时选择“从...加载”。
1
另一种选择是:调用部分
- 有一个请求
- 打开的soapUI项目XML文件
- 搜索CON创建的soapUI项目:请求与您自己的XML请求
- 保存并重新加载项目在soapui
3
一个简单和更自动化的方式来做到这一点是使用Groovy脚本来自动创建一个目录,你有你的XML请求文件的一步步测试要求:
- 手动创建一个TestCase。
- 添加一个空的TestStep请求,我们将用它作为模板来创建其他请求。
- 添加一个groovy testStep,它使用下面的代码导入所有文件,并执行它以创建testSteps。
你SOAPUI前常规执行代码的样子:
和必要的Groovy代码:
import com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestRequestStepFactory
import groovy.io.FileType
// get the current testCase to add testSteps later
def tc = testRunner.testCase
// get the testStep as template to create the other requests
def tsTemplate = tc.getTestStepByName("TestRequest template")
// create the factory to create testSteps
def testStepFactory = new WsdlTestRequestStepFactory()
def requestDir = new File("/your_xml_request_directory/")
// for each xml file in the directory
requestDir.eachFileRecurse (FileType.FILES) { file ->
def newTestStepName = file.getName()
// create the config
def testStepConfig = testStepFactory.createConfig(tsTemplate.getOperation(), newTestStepName)
// add the new testStep to current testCase
def newTestStep = tc.insertTestStep(testStepConfig, -1)
// set the request which just create with the file content
newTestStep.getTestRequest().setRequestContent(file.getText())
}
希望这有助于
+0
“your_xml_request_directory”是绝对路径吗?或者,如果它是一个相对路径,它与哪个目录相对? – 2016-09-01 13:36:50
+1
@HuukchanKwon在我的例子中'/ your_xml_request_directory /'指的是一个绝对路径。我不知道,但我想如果你使用相对路径,它是相对于soapui执行目录。 – albciff 2016-09-01 13:40:23
相关问题
- 1. 如何在Spring W中将SOAP请求消息发送到接受Soap请求消息的服务器?
- 2. 如何打印SOAP请求消息?
- 3. 如何使用soapui发送SOAP请求
- 4. 如何将参数传递给SOAPUI中的SOAP请求
- 5. 从groovy插入xml标签到SOAPUI中的SOAP请求
- 6. 使用jquery的onvif soap消息请求
- 7. SoapUI发送双重SOAP请求
- 8. 如何获取SOAP请求消息的xml表示?
- 9. 如何发送现有的SOAP请求现有WSDL
- 10. SoapUI从soap请求中的文件中插入xml
- 11. 如何将Int传入SOAP中的SOAP请求
- 12. 如何在PHP中传递SOAP请求属性(如SoapUI所示)
- 13. 如何将JAXBElement作为SOAP消息的子节点附加到SOAP消息
- 14. 从SoapUI重新创建一个可用的SOAP请求到PHP
- 15. 如何在Java中捕获SOAP请求和响应消息?
- 16. 如何将SOAP模板加载到Java中的SOAP消息中?
- 17. 将SOAP消息标识为请求或响应
- 18. SoapUI - 自动添加自定义SOAP头到出站请求
- 19. 如何将xml String添加到Soapui groovyscript的请求中?
- 20. 如何使用JAX-WS将SOAP头添加到SOAP请求?
- 21. 如何传递消息凭证 - TransportWithMessageCredential - SOAP请求中没有凭证
- 22. SOAP消息到期
- 23. Sass - 如何将消息导入指令
- 24. 如何使用SOAPUI将消息发送到IBM MQ
- 25. 如何将所有断言失败消息打印到SoapUI的HTML报告中
- 26. 消息HTTPS请求
- 27. 获取请求的客户端的IP地址(SOAP消息)
- 28. SoapUI IP请求者
- 29. SoapUI错误消息
- 30. 如何将时区信息添加到SOAP请求的日期时间
这就是我要去没有看到其他选项。将会回落到这个如果有效 – 2016-04-21 23:12:03