I try to validate login message but password is correct it also reflect 2nd condition also.
var jsonData1 = pm.response.json();
if (pm.response.json().success == true) {
pm.test("Login Successfull", function () {
pm.expect(jsonData1.msg).to.be.eql("Login Successfull")
});
} else (pm.response.json().success == false)
pm.test("Incorrect Password" , function () {
pm.expect(jsonData1.msg).to.be.eql("Incorrect Password")
});
My question:
How to use if else condition for validate message for login
I found
{Incorrect Password | AssertionError: expected ‘Login Successfull’ to deeply equal ‘Incorrect Password’ } this also.