Forum Discussion

vijaydi's avatar
vijaydi
Contributor
13 years ago

Response time of each request in soapUI using groovy script

Hi,

Could anyone please help me with the groovy code to get the round trip response time of each request in soapUI.

Thank you.
  • martinem's avatar
    martinem
    New Contributor
    But how to access messageExchange object in mock's AfterRequest?
  • if you have a setup like the one in the image.

    script in testcase.1

    runner = testRunner.testCase.testSuite.getTestCaseByName('testcase.2').run(null, false)
    log.info(runner.getTimeTaken() + 'ms')


    script in testcase.2

    import java.util.Random
    rand = new Random()
    sleep(rand.nextInt(10000))