1
* def xyz = 'abc'
* def abc = {"pratyush" : '#(xyz)'}
* def editJson =
"""
function(s)
{
var x = s.x
karate.log(x)
}
"""
* def p = call editJson ({"x" :abc})

actual output -{pratyush=abc} expected output - {"pratyush":'abc'}

1 Answer 1

1

use pretty to print it like JSON

karate.log(karate.pretty(x))

other than that it doesn't make it as invalid JSON

* def editJson =
"""
function(s)
{
var x = s.x
return x;
}
"""
* def p = call editJson ({"x" :abc})
* print p
# {"pratyush":'abc'}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.