How to use 'OR' operation with any test

{
“status”: 0,
“errorList”: ,
“message”: “Wrong password.”,
“response”: {}
}

but message can any thing and i want to verify with OR condition.

Hey @amit.nandha

Welcome to the community!! :trophy:

It’s not too clear what you’re trying to do or what you’re trying to check for, with the info provided. Is it just the message value you’re looking to create a test for?

Are you able to post an example of a test that you have created?

If you’re thinking in terms of the different assertions that you can use with the pm.expect() function, you might want to take a look at the chaijs docs, to see what’s available for you to use.

Hi Danny,

My scenarios is mention as below:

Response:

{

"status": 0,

"errorList": [],

"message": "Wrong password.",

"response": {}

}

But depending on input “message” value is change like “Email is wronge”

If I want to verify the message in one test case so I am going with below code:

var JsonRespons = JSON.parse(responseBody);

pm.test(“Invalid credentials”, function()

{

pm.expect(JsonRespons.message).to.eql(“Please verify email (or sign up first).”

        >> "Wrong password.");

console.log("Expected Message : " +JsonRespons.message);

});

I want to ORing to message in one test case.

So my question is how can I handle this scenarios using one test case.

Awaiting reply …

Regards,

Amit Nandha