Forum Discussion
M_McDonald
13 years agoSuper Contributor
Does this help?
Change the assertion to this:
Now add a Groovy script step after the request that resets the flag.
This is to allow the request to write the files if it is re-executed due to looping.
Change the assertion to this:
if (context.alreadyWritten == null || !context.alreadyWritten) {
def startDate = new Date().format("yyyy_MM_dd_HHmmssSSS")
def filename = "C:/Users/smipan/Desktop/SoapUIPRO/LiveEvents/EventId_"+startDate+"_LiveFeeds.csv"
dataStore = new File( filename )
for (i in 1..8)
{
def current = "Test Line" + i
log.info current
dataStore.append( current)
}
context.setProperty('alreadyWritten', true)
} else {
log.info ('Already written!')
}
Now add a Groovy script step after the request that resets the flag.
context.setProperty('alreadyWritten', false)
This is to allow the request to write the files if it is re-executed due to looping.