【发布时间】:2015-01-02 06:54:42
【问题描述】:
我有一个包含我的肥皂请求的目录,我想重用它们来构建测试套件。
我尝试使用 ENTITY 定义但无法使其工作,而使用 xi:include 来包含我想要包含的代码似乎soapUI 无法识别它。
我的实际项目结构如下:
<con:soapui-project>
<con:interface >
<con:endpoints>
<con:endpoint>http://localhost/GestionePreventiviRemoteImpl/GestionePreventiviService_v1</con:endpoint>
</con:endpoints>
<con:operation isOneWay="false" action="" name="aggiornaPreventivo" bindingOperationName="aggiornaPreventivo" >
<con:settings/>
</con:operation>
<con:operation isOneWay="false" action="" name="creaPreventivo" bindingOperationName="creaPreventivo" >
<con:settings/>
</con:operation>
<con:operation isOneWay="false" action="" name="recuperaPreventivo" bindingOperationName="recuperaPreventivo">
<con:settings/>
</con:operation>
</con:interface>
<con:testSuite name="GestioneServicePortBinding TestSuite">
<con:testCase name="aggiornaPreventivo TestCase">
<con:testStep name="aggiornaPreventivo">
<con:config>
<con:interface>GestioneServicePortBinding</con:interface>
<con:operation>aggiornaPreventivo</con:operation>
<con:request name="aggiornaPreventivo">
<con:endpoint>http://localhost/GestionePreventiviRemoteImpl/GestionePreventiviService_v1</con:endpoint>
<con:request>
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://simulatore.Prodotto.be.service.bmed.it/v1">
<soapenv:Header/>
<soapenv:Body>
<v1:aggiornaPreventivo>
<input>
<aggiornaPreventivoDTO>
<codPrev>1001</codPrev>
<codCliente>205</codCliente>
.....
</aggiornaPreventivoDTO>
</input>
</v1:aggiornaPreventivo>
</soapenv:Body>
</soapenv:Envelope>
]]>
</con:request>
</con:request>
</con:config>
</con:testStep>
</con:testCase>
</con:testSuite>
</con:soapui-project>
我需要将请求包含在测试用例中,以便在测试套件之外处理输入参数。所以像:
<con:testStep name="aggiornaPreventivo">
<con:config>
<con:interface>GestioneServicePortBinding</con:interface>
<con:operation>aggiornaPreventivo</con:operation>
<con:request name="aggiornaPreventivo">
<con:endpoint>http://localhost/GestionePreventiviRemoteImpl/GestionePreventiviService_v1</con:endpoint>
<con:request>
<xi:include href="aggiornaPreventivoRequest.xml" parse="xml" xpointer="title"/>
</con:request>
</con:request>
</con:config>
</con:testStep>
aggiornaPreventivoRequest.xml 的内容如下:
<v1:aggiornaPreventivo>
<input>
<aggiornaPreventivoDTO>
<codPrev>1001</codPrev>
<codCliente>205</codCliente>
.....
</aggiornaPreventivoDTO>
</input>
</v1:aggiornaPreventivo>
感谢您的帮助!
【问题讨论】:
标签: soapui test-suite