尝试在groovy脚本中执行以下代码时,我得到 java.lang.IndexOutOfBoundSException 。 什么可能是它的解决方案...如果你们可以帮助我,那将是一个很好的帮助。
我已经提到过以下代码: -
def project = context.testCase.testSuite.project
def testSuite = project.getTestSuiteAt(1)
def testCase = testSuite.getTestCaseAt(0)
wsdlTestSteps = testCase.getTestStepsOfType( com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.class ) //test step
def testStepCount = wsdlTestSteps.size()
( 0..< testStepCount).each
{
if (!(wsdlTestSteps[it].getAssertionByName("Not SOAP Fault")))
{
wsdlTestSteps[it].addAssertion("Not SOAP Fault")
}
if (!(wsdlTestSteps[it].getAssertionByName("SOAP Response")))
{
wsdlTestSteps[it].addAssertion("SOAP Response")
}
log.info("Assertion created into Teststep :: " + testCase.getTestStepByName(wsdlTestSteps[it].getName()).getName().toString())
}
另外,有什么办法可以在脚本中添加架构合规性和xpath吗? 谢谢,