Reputation: 81
I want to change the values present in an array using karate.set as i am using it in if condition my code is:
> * def name = ["ankit"]
> * def value = 2
> * eval if ( value == 2) karate.set('name', 'ANKIT_DESAI')
but the value of name is not changing
Upvotes: 1
Views: 662
Reputation: 4239
Assume that as a list and modify value based on index
* def name = ["ankit"]
* def value = 2
* eval if ( value == 2) name[0] = "ANKIT_DESAI"
Upvotes: 2