Forum Discussion
- nmrao
Champion Level 2
What do you mean by "convert Dateformat from 2017-11-03T18:42:00Z to sec?"
Hope you know why property transfer is used and you may aware that it is not for applying a custom logic.
You could replace Property Transfer step with "Script Assertion" / Groovy Script test step to achieve the same.
But you need to clarify what exactly is required.- testhrishiFrequent Contributor
I was thinking some kind of xpath function that can be use here
- nmrao
Champion Level 2
Would you please clarify the question posed in the last reply?
- testhrishiFrequent Contributor
I was able to get around this using groovy and getTime() function
- MikeGatwardOccasional Contributor
Might be nice to share the solution ?
- testhrishiFrequent Contributor
This worked for what I was trying to do.
def format1 = context.expand( '${#TestCase#parseEnd}' )
def format2 = context.expand( '${#TestCase#IncorporationStart}' )
def format3 = Date.parse("yyyy-MM-dd'T'hh:mm:ss'Z'", format1)
def format4 = Date.parse("yyyy-MM-dd'T'hh:mm:ss'Z'", format2)
long timeDiff = (format4.getTime() - format3.getTime())/1000