Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.
Here’s an outline with best practices for making your inquiry.
My question:
Details (like screenshots):
I am using if else statement condition for login test and try to success value should be in true and should be match msg for all different condition in body value
let jsonData1 = pm.response.json(),
msg = ["Login Successfull",
"Incorrect Password",
"Please register first." ]
if (jsonData1.success === "false") {
pm.test("password is wrong"${jsonData1.msg}, () => {
pm.expect(jsonData1.msg).to.be.oneOf("Incorrect Password")
})
else {
pm.test("Login Successfull" $ {jsonData1.msg}, () => {
pm.expect(jsonData1.msg).to.equal("Login Successfull")
}
}
}`
How I found the problem:
There was an error in evaluating the test script: SyntaxError: Unexpected token ‘else’
I’ve already tried: