Forum Discussion

Xardas's avatar
Xardas
New Contributor
4 years ago
Solved

How to get assertion info in groovy

Hello,   how can i get the assertion data in groovy like the following example:   for example the first: _____ Valid HTTP Status Codes Status: Failed Expected; 202 Current: 403 Error ...
  • HimanshuTayal's avatar
    4 years ago

    Xardas :

     

    Hope below code will help you out:

    def assertionsList = testRunner.getTestCase().getTestStepByName("TEST STEP NAME").getAssertionList()
    for( e in assertionsList){
        log.info e.getToken() //gives the value of the content to search for
        log.info e.DESCRIPTION
        log.info e.ID
        log.info e.LABEL
        log.info e.toString()
    }