Run Folder = Fail, Manually Run = Pass

Hi, everyone.

I run-folder with a collection of Posts and Get at the end to confirm Post

Running the entire folder(Error)
Script:

pm.test(pm.info.requestName + ": Test For Successful Header Validation", function () {
    var jsonData = pm.response.json();
    pm.expect(jsonData[0].success).to.eql(true);
});

pm.test(pm.info.requestName + ": Test for Response Case Formatting", function () {
    pm.expect(pm.response.text()).to.include("success");
    pm.expect(pm.response.text()).to.include("data");
    pm.expect(pm.response.text()).to.include("-");
});

pm.test(pm.info.requestName + ": Status 200", function () {
    pm.response.to.have.status(200);
});

Response body:
{363C7E70-7B80-4363-B0EA-CEDA98CE91DF}

Manual Run:

[
    {
        "success": true,
        "data": {
            "apiObjectID": "409dac45-2ad8-4906-bc02-56e19f4a6579"
        }
    }
]

I had a look at previous Topics of a similar issue.

There are No orange dot from a delayed save or file that needs to be located. This is posting to a db located on local SQL.

DB is restored and services restarted before each run.

Console log the response data. What was actually returned for the “Entity Relationship Create” request? The error seems to suggest that it returned false, therefore failing the test.

On a side note, your “Test for Response Case Formatting” can be done using the JSONSchema functionality. I would recommend having a look at that. It can ensure expected keys are in the response, it can also check for the formatting of values. You can check that the “success” key exists in the correct place in the response, and that the value is a boolean.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.