From the solution you posted I wasn’t sure if you were trying to get the pli:JoSequenceID or the pli:GuidSequenceID, so in my solution I just used both. When I run this locally in a mock with the example response you provided it all passes.
//Convert XML response to JSON
var jsonData = xml2Json(responseBody);
console.log("JSON response", jsonData);
//Get JoSequenceID value
var JoSequenceID = jsonData["pli:GetJooyaltyOnlineStatusResponse"]["pli:ResponseHeader"]["pli:JoSequenceID"];
console.log("JoSequenceID is", JoSequenceID);
//Test JoSequenceID is not null
pm.test("JoSequenceID is not null", function () {
pm.expect(JoSequenceID).not.eql(null);
});
//Test JoSequenceID is not 0
pm.test("JoSequenceID is not 0", function () {
pm.expect(JoSequenceID).not.eql(0);
});
//Get GuidSequenceID value
var GuidSequenceID = jsonData["pli:GetJooyaltyOnlineStatusResponse"]["pli:ResponseHeader"]["pli:GuidSequenceID"];
console.log("GuidSequenceID is", GuidSequenceID);
var regex = /^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/;
//Test GuidSequenceID is not null
pm.test("GuidSequenceID is not null", function () {
pm.expect(GuidSequenceID).not.eql(null);
});
//Test GuidSequenceID is not 0
pm.test("GuidSequenceID is not 0", function () {
pm.expect(GuidSequenceID).not.eql(0);
});
//Test GuidSequenceID is a GUID
pm.test("GuidSequenceID is a GUID", function () {
pm.expect(regex.test(GuidSequenceID));
});
Mick