My question:
I am trying to add two environment variables together to get a result i.e. 4 + 7 expecting 11, however when I put the + sign in it simply merges them to give a result of 47.
I have a similar requirement to confirm that variable a - variable b also equals 11. I can get this working with this test below
pm.test (“Check balance correct”, function () {
var jsonData = pm.response.json();
pm.expect(jsonData[0].id).to.eql(pm.environment.get(“id1”)-(pm.environment.get(“id2”)));
How I found the problem:
I am trying to confirm that after in a get have been obtained and written to the environment variables, followed by a Post that will reduce one value and increase another that the result that is sent in the response body matches that expected.
I’ve already tried:
I have tried putting the + inside “” and () but this does not work, I have also tried Add, none of which work.