Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Karate: verifying plaintext integer response – no step-definition method match found

I’m testing an endpoint which returns an integer in plaintext format. I’d like to check that the response value is greater than 1. Printing the response tells me that it is indeed. However, when I try to automate this check, I keep getting the following error:

...
When method POST
Then status 200
* print response #returns 643
And response > 1

Error: no step-definition method match found for: response > 1

How can I accomplish this?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I think you are looking for this:

And assert (response * 1) > 1

Refer docs: https://github.com/karatelabs/karate#assert

Note that the response will be plain-text by default.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading