Getting the milliseconds between 2 TestSteps
I am trying to check the performance of a deploy API.
I am using these steps to get the time it takes to deploy.
-Start Time ([Groovy Script] This sets a custom property with the current time in this format "HH:mm:ss.SSS")
-Deploy ([API] This only start the job, we need another step to make sure the job is done and done right)
-Transfer jobID (Standard property transfer)
-Query Job Status ([API] This gets the status of a job from the jobID)
-Check Job Status ([Groovy Script] a script that goto "Query Job Status" if job is not complete)
-End Time (This sets a custom property with the current time in this format "HH:mm:ss.SSS" and adds 1 to a counter)
-Loop condition (If counter is not equal to predetermined amount, goto TestStep "StartTime")
How do I calculate the milliseconds between the 2 custom properties "StartTime" and "EndTime"?
Or
How do I get the time between 2 TestSteps?
Whichever makes more sense to use.
This is how I create the time stamp in the custom properties:
String strCurrentDate = new Date().format("HH:mm:ss.SSS")
startTlime = strCurrentDate
testRunner.testCase.setPropertyValue("StartTime", startTime)
This is my last attempt at getting the difference between the 2 values
def startTime = testRunner.testCase.getPropertyValue( 'StartTime' )
def endTime = testRunner.testCase.getPropertyValue( 'EndTime' )
Date ParsedStartTime = Date.parse("HH:mm:ss.SSS", startTime)
Date ParsedEndTime = Date.parse("HH:mm:ss.SSS", endTime)
Date rateDuration = Date.(ParsedEndTime - ParsedStartTime)
I've tried many ways to manipulate the data like String, Date, .format(), .parse(), alone and combined. I am not able to make it work
Any suggestions?
That is the closest to what I've actually done.
for every loop I write the times in a custom property with an iteration in the property name (StartTime1, EndTime1)
The last step of the TC is a groovy script that logs all of the start and end time into a single text file which I import in Excel to parse and get results.
I was hoping for soapui to get the final answer for this test but after all that research and the suggestions here, I think that only excel can offer me the answer I seek.
Thanks to you two for the help.