I can get two status in the Test Result tab - PASSED or FAILED.
I want to extract this information (PASSED or FAILED) and get it to the variable. I need only word - Passed or Failed. I attached screenshots what I want to get.
What you can do though is edit the test cast and create the variable and result here instead.
For example.
pm.test("Status code is 200", () => {
// set inital status to fail
pm.collectionVariables.set("testStatus", "FAILED")
// your assertion
pm.response.to.have.status(200);
// If the assertion fails, then the current pm.test execution will end immediately.
// No further code in this test block will execute.
// The testStatus will remain as failed.
// If the next line executes, it means that the assertion passed.
pm.collectionVariables.set("testStatus", "PASSED")
});