lundi 30 mars 2020

How to handle different response for the same request on Karate api testing?

I have a question about how to handle different responses for the same request in Karate api test. E.g. The same request: Given path '/tickets/2000' When method get Response: 1> if ticket #2000 is not expired, then match response = expected result 2> if ticket #2000 is expired, then matching response.error = 'Ticket is expired'

So how to match the 2 different results. I need to handle both. Can I use "Try... Catch", how to use it? Can you give me a syntax example in Karate, please?

Thanks

Aucun commentaire:

Enregistrer un commentaire