szalejot
12 years agoNew Contributor
Parametrize load test duration in SoapUI
I am currently using SoapUI for load testing my web service. Typical test case includes few load tests. These test are part of integration testing. I have managed how to call this tests from java class during integration-test phase in maven:
What I want to do is to parametrize load test duration, so I can run quite short tests (for integration test purposed only) when I am during typical development deploy and be able to do long extensive test during night test builds.
How can I achieve that? Can I do this in Setup Script of load test (if yes, please help with this, I have no experience with SoapUI scripting) or is there any other way to achieve this?
@Test
public void testExecute() throws Exception {
WsdlProject project = new WsdlProject("src/test/soapui-project.xml");
for (TestSuite testSuite : project.getTestSuiteList()) {
for (TestCase testCase : testSuite.getTestCaseList()) {
TestRunner runner = testCase.run(new PropertiesMap(), false);
Assert.assertEquals(Status.FINISHED, runner.getStatus());
for (LoadTest loadTest : testCase.getLoadTestList()) {
LoadTestRunner loadRunner = loadTest.run();
Assert.assertEquals(Status.FINISHED,
loadRunner.waitUntilFinished());
}
}
}
}
What I want to do is to parametrize load test duration, so I can run quite short tests (for integration test purposed only) when I am during typical development deploy and be able to do long extensive test during night test builds.
How can I achieve that? Can I do this in Setup Script of load test (if yes, please help with this, I have no experience with SoapUI scripting) or is there any other way to achieve this?