First of all, I am not a developer. Therefore, I don’t have much experience with JavaScript.
Problem:
On my current project, I have a problem with my test script. This script is used to write a simple log to the console for about 3755 requests (collection runner). With this script I expect, that there is a log entry (console) with every single request. But that’s not the case. If I copy all logs to the clipboard (button “copy all logs to the clipboard”, hid network, no timestamps), I have only 2500 entries instead of 3755 (if I make less requests, it’s seems to be okay).
The simplified script looks like this:
function writeConsoleLog()
{
try
{
var responseJson = xml2Json(responseBody);
console.log(responseJson["SOAP-ENV:Envelope"]["SOAP-ENV:Body"]["example:exampleOne"]["example:exampleTwo"]);
} catch (ex)
{
console.log("An exception occurs.");
//console.log(ex.name+" "+ex.message);
}
};
writeConsoleLog();
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
pm.test("Body matches string", function () {
pm.expect(pm.response.text()).to.include("someString");
});
My environment:
Windows 10
Chrome 97.0.4692.7
web.postman.co with desktop agent
Questions:
Is something wrong with my test-script? Are there any known limitations in this direction (2500 entries instead of the expected 3755)?