Testing / Karate Framework Interview questions
What are Karate's built-in type markers, like #number and #string?
Type markers are special string values Karate recognizes inside a match expression to assert on a value's type or shape rather than its exact value, which matters for fields like IDs, timestamps, or UUIDs that are unpredictable but still need validating.
| Marker | Meaning |
#number | Value must be a number, any value. |
#string | Value must be a string, any value. |
#boolean | Value must be true or false. |
#null / #notnull | Value must be null, or must not be null. |
#array / #object | Value must be a JSON array, or a JSON object. |
#uuid | Value must match a UUID pattern. |
#regex <pattern> | Value must match the given regular expression. |
#ignore | Skip validating this field entirely. |
These markers can be combined directly inside a full-object match, letting a single assertion validate an entire response's shape: fixed values checked exactly, and unpredictable fields checked only for the right type, all in one statement instead of separate assertions per field.
More Related questions...