I am having two files one is json and one is xml. I want to print json or xml file content on the basis of the isJson
flag. But I am seeing that when the isJson == false
its returning the json content from the below program.
Scenario: ternary operator over different type files
* def isJson = false
* json jsonFile = {name : 'user'}
* xml xmlFile = <name>user</name>
* def payload = isJson == true ? jsonFile : xmlFile
* print 'payload --->',payload
console output :
INFO com.intuit.karate - [print] payload ---> {
"name": "user"
}