yek
yek

Reputation: 127

Using external libraries in Karate framework

I would like to use external JS libraries such as JsonQ.js(https://github.com/s-yadav/jsonQ) for validating my complex JSON response. Can some one guide me on how to plug external libraries and use them as part of Karate feature files.

Upvotes: 2

Views: 1290

Answers (1)

Sree
Sree

Reputation: 351

I don't think you need an external library to validate any complex JSON responses in Karate framework. Karate's built-in capability is really strong enough to do any JSON validations. I used to work on projects which will give complex JSON responses which can be very easily validated using Karate. Using Karate you can validate

  • Any key & values
  • JSON Objects, JSON arrays
  • Subsets of JSON's from a response
  • You can iterate and check values
  • Headers
  • Status
  • Fuzzy Matching (Check null, boolean, string, etc)
  • Use regular expressions for validations
  • JSON schema validations etc

I would suggest going through the documentation and webinars of Karate to understand the details of validation capabilities.

Upvotes: 2

Related Questions