Usha_Kodali
15 years agoFrequent Contributor
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
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