1

i have set continueOnStepFailure to true before match step, i am using karate core . i am still unbale to get desired result of each attribute validation of json. After the first failure next values are not getting compared. Do we need to take care of any additional settings apart of karate version 1.0 and above?

* def response1 = 
    """
        {
            "name": "Tom",
            "gender": "male",
            "age": "20"
            
        }
    """
    * def response2 = 
    """
        {
            "name": "Jon",
            "gender": "female",
            "age": "21"
        }
    """ 
    * configure continueOnStepFailure = { enabled: true, continueAfter: false, keywords: ['match'] }
    * match response1 == response2
    * configure continueOnStepFailure = false

Output of above code is ---------->

match failed: EQUALS
$ | not equal | match failed for name: 'name' (MAP:MAP)
{"name":"Tom","gender":"male","age":"20"}
{"name":"Jon","gender":"female","age":"21"}
$.name | not equal (STRING:STRING)
'Tom'
'Jon'
classpath:LIB_API/SampleTest.feature:51
Markus
  • 5,976
  • 5
  • 6
  • 21
Pmtester38
  • 21
  • 1
  • I think you have already read this: https://stackoverflow.com/a/54108755/143475 - I'll just say that personally I never use this feature and it is contributed by the community. you are welcome to contribute code or documentation to fix it. my recommendation is that this concept of a "soft assertion" is over-rated, and you should focus on just having some test-automation in place and move on. – Peter Thomas Sep 23 '22 at 13:46

0 Answers0