Forum Discussion
SmartBear_Suppo
SmartBear Alumni (Retired)
HI,
in groovy
assert ProductOfferingCode == 'something' throws AssertionException so the flow of the script ends there.
Here is the simple tweak
So you can add which assertions failed and if there is something in assertionList it means that somethig failed.
Hope this helps
regards
nebojsa
SmartBEar Software
in groovy
assert ProductOfferingCode == 'something' throws AssertionException so the flow of the script ends there.
Here is the simple tweak
def assertionList = []
//Assertion 1
def ProductOfferingCode = context.expand(...something...)
ProductOfferingCode == 'something' ? log.info "Assertion1 pass" : assertionList.add("Assertion1 fails")
//Assertion 2
def productOfferingSource = context.expand(...something...)
productOfferingSource == 'something' ? log.info "Assertion2 pass" : assertionList.add("Assertion2 fails")
//Assertion 3
def isSubscription = context.expand(...something...)
isSubscription == 'something' ? log.info "Assertion3 pass" : assertionList.add("Assertion3 fails")
assert assertionList.isEmpty() : assertionList.toString()
So you can add which assertions failed and if there is something in assertionList it means that somethig failed.
Hope this helps
regards
nebojsa
SmartBEar Software
Gkm
9 years agoContributor
It is not working for me , Got compilation error
Related Content
- 14 years ago
- 10 months ago
- 2 years ago
- 8 years ago
Recent Discussions
- 5 days ago
- 9 days ago