Using soapUI free version(5.4.0(.我有一个简单的带有测试用例的项目,其中包含测试步骤和负载测试,例如:
TestCase
Test-steps
one
two
LoadTests
LoadOne
LoadTwo
我想在单独的脚本中使用Groovy脚本运行LoadOne
和LoadTwo
负载测试。怎么做?
假设您正在执行同一项目中的Groovy测试步骤,以下脚本将执行名为LoadOne
的负载测试:
import com.eviware.soapui.impl.wsdl.loadtest.*;
// Get the load test
def loadTest = testRunner.testCase.getLoadTestByName("LoadOne");
// Run the load test
WsdlLoadTestRunner loadTestRunner = new WsdlLoadTestRunner(loadTest);
loadTestRunner.start(true);
loadTestRunner.waitUntilFinished();
然后,当然,对其他负载测试执行相同的操作。