soapui-maven-plugin需要帮助打印测试请求和测试结果

时间:2015-09-28 20:27:01

标签: java maven plugins automation soapui

我正在使用一个包含2个测试套件的测试项目。 First Test Suite具有类似于状态的步骤  地址测试案例 - 鉴于请求是使用地址 收到带有效地址的响应时 然后做必要的行动  地址测试案例 -  地址测试案例 - 每个测试用例的地址都设置为测试用例级别。每个单独的步骤都有一个脚本,可以调用其他库测试套件&然后调用该测试套件中的基本测试步骤并将参数传递给该测试用例。 因此,第一个测试套件中的步骤如下:

def proj= null
def workspace = testRunner.testCase.testSuite.project.getWorkspace();
proj= workspace.getProjectByName("ABC")
def testCase = proj.testSuites["ABC Library"].testCases["Successful ABC Steps" ]
testRunner.testCase.setPropertyValue( "addressLine1", "1111 Winters Chapel Rd NW, Atlanta, GA 30360" )
testRunner.testCase.setPropertyValue( "city", "Atlanta" )
testRunner.testCase.setPropertyValue( "state", "GA" )
def testStep = testCase.getTestStepByName("Given a request with a valid address is made")
def runner = null
runner = testStep.run(testRunner, context)

并且库中的相应步骤在下面作为请求和实际web服务端点的一部分:

<address xsi:type="ns:USPostalAddress">
<ns:addressLine1>${#TestCase#addressLine1}</ns:addressLine1>
<ns:city>${#TestCase#city}</ns:city>
<ns:state>
<ns:name>${#TestCase#state}</ns:name>
</ns:state>
</address>

这个测试用例在SoapUi中运行良好,但是当尝试运行java时,我无法将测试步骤的参数从测试套件传递到同一项目xml中另一个测试套件中的其他测试步骤。此外,由于第一个测试步骤是脚本,它只是告诉运行器状态是INITIALIZED但是如何获得在内部调用的测试步骤中实际调用的请求xml和响应xml。请帮忙。提前谢谢......

0 个答案:

没有答案