Forum Discussion

Usha_Kodali's avatar
Usha_Kodali
Frequent Contributor
15 years ago

counting number of assertions and printing the status

Hi,

I have numerous assertions in a groovy test step.
I want to print the status of each assertion. How to achieve this?

example I have following assertions in groovy test step call Query-VideoMetaData

//assert videoDescr
assert sqlDisplayTitle == videoDescrList

//assert videoID
assert sqlmusicViedoID == artistvideoIDList

//assert RecordLabel
assert sqldisplayLabel == recordLabelList

//assert Album Names
assert sqldisplayTrack == albumList

//assert ArtistNames
assert sqlDisplayArtist == artistNameList

Now I want to know count of assertions and status and if there is any error want to print the assertion which failed.

Ex: No of Assertions: 5
assert sqlDisplayArtist == artistNameList - Failed.
assert sqldisplayTrack == albumList - OK
No RepliesBe the first to reply