Smart Assertion Values capturing in Groovy
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Smart Assertion Values capturing in Groovy
Hi Guys,
I am new to Ready API and still in learning phase . Currently , I am looking into the smart assertion , where in my smart assertion I am getting the error in a particular test step, I want to capture that Test step request - smart assertion response and display it in my HTM Report. Kindly let me know if there is anyway .
[While googling I found a way for capturing it for all the test step in project , but dint find for selected test step and tried multiple times, still getting errors]
Thanks & Regards,
Sabitha D.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This worked for me:
log.info "////////////////////////////////////////////////////////"
testRunner.testCase.testSteps.each
{ name,props ->
log.info "Test step name: $name"
// check that the testStep class support assertions // (for example groovy testStep doesn't)
if(props.metaClass.respondsTo(props, "getAssertionList"))
{
// get assertionList
props.getAssertionList().each
{
// display the assertion Label Name - assertion Status - assertion Error Message
log.info " $it.label - $it.status - $it.errors"
}
}
}
log.info "////////////////////////////////////////////////////////"
>>> If you find the above solution useful then please give Kudos/Like to this message <<<
