I am using Karate for API testing. In my Karate script, I plan to call a scenario (S1) of a feature file and set the value of its response to a variableA; Then assign the variableA to variableB Then call another scenario(S2), inside S2, the value of variableB will be updated
The behaviour now is the value of variableA had been updated as well. is this what Karate intentionally designed? Can anyone suggest how to keep variable A's value not changed?
Below is my code
* def variableA = karate.call ('classpath:com/features/mocking/mapMockingServer.feature@postPH_201', {'wireMockParam': wireMockParam}).wireRes
* print variableA
* wireMockParam.mockRequestBody = variableA
# wireMockParam.mockRequestBody will be updated inside of mapMockingServer.feature@postPE_200
* def mapPostPERes = karate.call ('classpath:com/features/mocking/mapMockingServer.feature@postPE_200', {'wireMockParam': wireMockParam})
* print variableA
The print variableA in above code shows different value. Can anyone pls advice?
Thank you in advance