Karate framework - How to check conditional OR for two string for a attribute

Nagesh Pathrut

I want to compare two string and need to check for any of the string value for an attribute as below : "firstName": "#? _ == '#string1' || _ == '#string2'".

this I provided in JSON as below

{
  "id":"#number",
  "firstName":"#string",
  "lastName":"#string",
  "city":  "#? _ == '#Boston' || _ == '#Bijing'"
}

but it is not comparing string ? please help. AM I correct here.

Babu Sekaran

No need for using # before the string if it is not a variable reference

{
  "id":"#number",
  "firstName":"#string",
  "lastName":"#string",
  "city":  "#string? _ == 'Boston' || _ == 'Bijing'"
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to check values of an attribute if it is present in json schema using karate framework

How to do conditional check in karate response?

Karate - Conditional logic with string and array

karate.append not Working with Conditional Check

How to add two data attribute check in cypress?

Problem With Conditional Check When Two Elements of Array are Same String Value

conditional string check in javascript

How to assert substring in karate framework

How to set Proxy in Karate Framework

How to distribute Karate testing framework?

How to scroll by pixels in karate framework

How to check Palindrome String in Spring Framework?

Karate API framework - How can I check that a particular field value is not coming as duplicate under an array

How to check equality of two objects, one object's attribute's type is number other ones type is string but they are numbers

How to do conditional variables definition on Karate

How to add conditional wait for a response in karate?

How to implement conditional When method in Karate

How to check matching percentage of two string lists?

How to check if a string contains two asterisk characters?

How to Check If Two String Arrays are The Same

How to check if two [String: Any] are identical?

How to check if a two dimensional array includes a string?

ansible conditional check a item's attribute exist

How to validate Array object attribute if present in Karate

How to store entire raw request of an API in string variable using karate framework?

How to check if a string contains an other string (substring) in robot framework?

How to check if data-attribute does not contain a string with :contains in jQuery

How to use conditional attribute in POM

How to check a particular value on basis of condition in karate