Forum Discussion

smanikandan's avatar
smanikandan
Occasional Contributor
3 years ago

How to convert response time value in Milliseconds in seconds in ReadyAPI

How to convert response time value in Milliseconds in seconds in ReadyAPI
  • groovyguy's avatar
    groovyguy
    3 years ago

    Here's some code that should work as a groovy test step. You'll have to have to fill in the test step you care about, but this will get you the response time in seconds.

    def testStep = context.testCase.testSteps["ENTER TEST STEP NAME HERE"]
    
    def milliSeconds = testStep.testRequest.response.getTimeTaken();
    def seconds = milliSeconds / 1000;