khr*_*ris 0 xml groovy soapui data-driven-tests
我必须在soap ui中使用variable.as运行xml请求.我知道使用groovy脚本是可能的.我的变量($ variable)应该是这样的:
for (i = 0; i < 5; i++) {
createResult(34620000+i)
}
Run Code Online (Sandbox Code Playgroud)
请求看起来像:
SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="urn:xmethods-delayed-quotes">
<SOAP-ENV:Body>
<wq:test>
<Date xsi:type="xsd:string">2015-01-26</Date>
<Data ..."$variable"...</Data>
</wq:test>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Run Code Online (Sandbox Code Playgroud)
有人可以帮我发送这样的请求.或者可能有另一种方式发送多个请求?
在这里:定义一个包含3个步骤的测试用例
//run the SOAPRequestStep 5 times, increase as needed
for(int i=0;i<5;i++) {
testRunner.testCase.setPropertyValue('VARIABLE',i.toString()) //set whatever String value required in place of i.toString()
testRunner.runTestStepByName('SOAPRequestStep')
}
testRunner.runTestStepByName('ExitScript')
Run Code Online (Sandbox Code Playgroud)
log.info "Running Exit Script"
Run Code Online (Sandbox Code Playgroud)
现在运行测试用例.
| 归档时间: |
|
| 查看次数: |
6035 次 |
| 最近记录: |