????????????Groovy??????????????????????????????????μ????request??????????????????????
????1.??Groovy???????????"setUp"
def num = Integer.parseInt(testRunner.testCase.getPropertyValue( "count" ))
log.info num
num = (++num) % 2
testRunner.testCase.setPropertyValue( "count"?? num + "")
String[] acList = ["Loginn"+String.valueOf(Math.random()).substring( 0?? 5 )??"Loginn"+String.valueOf(Math.random()).substring( 0?? 6 )]
log.info num
log.info acList[num]
acList[num]
???????????????????????????????????????request??????д???????????dataloop????????????????????request?У????????request.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
<soapenv:Header/>
<soapenv:Body>
<sam:login>
<username>${setUp#result}</username>
</sam:login>
</soapenv:Body>
</soapenv:Envelope>
????2.??Groovy???????????"demo"
????testRunner.testCase.testSuite.getTestCaseByName("TestCaseDemo").setPropertyValue("username"??"Loginn"+String.valueOf(Math.random()).substring( 0?? 5 ))
????testRunner.testCase.testSuite.getTestCaseByName("TestCaseDemo").setPropertyValue("password"??"Loginn123")
??????????????У?TestCaseDemo???testcase?????????request??????д:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
<soapenv:Header/>
<soapenv:Body>
<sam:login>
<username>${#TestCase#username}</username>
<password>${#TestCase#password}</password>
</sam:login>
</soapenv:Body>
</soapenv:Envelope>