Can you help me to understand the scope of the variables in if statement?
* def a = "a"
* if ( 1 == 1 ) a = "b"
* print "a--",a
* def str =
"""
<tag>#(a)</tag>
"""
* print "str--",str
output :
[print] a-- a
[print] str-- <tag>b</tag>
edit: When i use karate.set('a',"b") instead of just a = "b" Then the output looks correct.
[print] a-- b
[print] str-- <tag>b</tag>
Aucun commentaire:
Enregistrer un commentaire