Forum Discussion

TheEnd's avatar
TheEnd
Occasional Contributor
6 years ago
Solved

Groovy script Assertion

Below is a sample from an XML file from my Response window of my project. I need to create a groovy assertion that will parse through the XML response file and compare the "Event" (looking for the same event name) and then compare the "EventTime" to make sure the time is 10 sec apart. I don't know groovy, so I piecing together a script from youtube and the internet, but I keep having issues. Help will be greatly appreciated...Thanks!

<Response>

<e>
<Tplus>8201.19</Tplus>
<SinceLast>8.29</SinceLast>
<EventTime>2019-12-16T19:35:37.189</EventTime>
<Event>trap:PATS-NE-MIB::patsConfigFileDownloadCompleteTrap"/test_lru_manifest.xml"XX.XX.XX.162</Event>
</e>
<e>
<Tplus>8211.24</Tplus>
<SinceLast>10.05</SinceLast>
<EventTime>2019-12-16T19:35:47.24</EventTime>
<Event>trap:PATS-NE-MIB::patsConfigFileDownloadCompleteTrap"/test_lru_manifest.xml"XX.XX.XX.162</Event>
</e>

<Response>