Forum Discussion

david2's avatar
david2
Occasional Contributor
4 years ago

How to Print to Assertion Log?

In ReadyAPI/SoapUI Pro, when a test case fails, I would like to print a custom message to the assertion log (see the "Compare" tab), as well as printing the endpoint that has failed. Is this possible? Or even simply printing the variables from the DataSource?

  • Thanks. Here two examples fail, pass cases respectively.

    //this will show the endpoint as assertion fails
    assert 1==0, context.expand( '${DataSource#EndPoint}' )

     

    //Below doesnot show anything as assertion passes
    assert 1==1, context.expand( '${DataSource#EndPoint}' )



  • nmrao's avatar
    nmrao
    Champion Level 3
    I know error log, script log.
    Where to find assertion log?

    Regarding the custom message, one can use like below groovy sample

    assert 1==0, 'My custom failure message: expected value does not match with actual'