Forum Discussion
M_McDonald
13 years agoSuper Contributor
You can put something like this in a Groovy script step (or Setup or Teardown scripts) where you want it to start:
and use this when you want to stop it:
def loadTest = testRunner.testCase.testSuite.getTestCaseByName('MyTestCase').getLoadTestByName('MyLoadTest')
loadTest.run()
and use this when you want to stop it:
def loadTest = testRunner.testCase.testSuite.getTestCaseByName('MyTestCase').getLoadTestByName('MyLoadTest')
if (loadTest.isRunning()) {
loadTest.getRunner().cancel('Test done')
}