Forum Discussion

prabalmtr's avatar
prabalmtr
Occasional Contributor
15 years ago

how to get response time in .XLS

Excel files are being used for request and response purpose in my project.

can anyone tell me how can i get response time of the each test suite in response excel file using property transfer.


if there is any groovy script available, plz share it!!!
  • prabalmtr's avatar
    prabalmtr
    Occasional Contributor
    i found one as follows-->

    // get result of previous teststep
    def result = testRunner.results[testRunner.results.size()-]

    // get target datasink, here named DataSink
    def dataSink = testRunner.testCase.testSteps['DataSink']

    // get the time taken as a string
    def tt = String.valueOf( result.timeTaken )

    // write it to the datasink
    dataSink.setPropertyValue( 'ResponseTime',tt )





    but it is showing errors like-->


    java.lang.ArrayIndexOutOfBoundsException: Negative array index [-1] too large for array size 0.


    when i removed "-1" from the above groovy script getting another error msg as-->

    java.lang.NullPointerException: Cannot get property 'TimeTaken' on null objects.

    [glow=green,2,300]
    it is needed urjently...
    plz respond!
    [/glow]