Forum Discussion
M_McDonald
14 years agoSuper Contributor
Assuming that the requests are called 'First' and 'Second', create a script assertion on the second request, and use this code:
This assumes of course that there will always be a 1-second difference in the successive LAST_UPDATE values which seems to be the maximum precision for the field.
import java.text.SimpleDateFormat
def fmt = new SimpleDateFormat('yyyy-MM-ddHHmmss')
def firstUpdate = context.expand( '${First#ResponseAsXml#//LAST_UPDATE/text()}' )
def secondUpdate = context.expand( '${ResponseAsXml#//LAST_UPDATE/text()}' )
Date firstDate = fmt.parse(firstUpdate)
Date secondDate = fmt.parse(secondUpdate)
assert firstDate < secondDate
This assumes of course that there will always be a 1-second difference in the successive LAST_UPDATE values which seems to be the maximum precision for the field.