0

My main objective is to check VarA not suppose to match with VarB. So I used assertion to check on this.

var jsonData = pm.response.json()
varA= jsonData.body.SubA
varB= jsonData.body.SubB
pm.expect (varA) .to.not.eql (varB)

It works fine with .to.eql, but not the case with not equal I saw from this site [https://www.chaijs.com/api/bdd/] it is not recommended. Any alternative I can use? Thank you

tqa
  • 11
  • 1
  • 8

1 Answers1

0

you can compare the variables before using expect and in the the expect, you can check the result of their comparison.

var flag = true;
if (varA != varB) 
flag = false;

pm.expect(flag).to.equal(false);
joinsaad
  • 853
  • 9
  • 13