Hi, Iโm using postman version 6.4.2 in MacOS mojave 10.14, chrome version 69.0.3497.100.
Iโm migrating my test from soapUI to postman and I have an script in groovy to get the MD5 of an image and then compares that md5 with another one but in postman Iโm not getting the same MD5, I followed the answer from this issue https://github.com/postmanlabs/postman-app-support/issues/2024 but Iโm still not getting the right MD5. This is my Test in postman:
pm.test("Set image url", function () {
var jsonData = JSON.parse(responseBody);
var iUrl = pm.globals.get("myUrl");
for(var i = 0; i < jsonData.images_array.length; i++){
var image = jsonData.images_array[i];
var url = iUrl + "/" + image.url;
pm.sendRequest(url, function(err, res){
var arr = res.stream;
var str = String.fromCharCode.apply(String, arr);
var md5 = CryptoJS.MD5(str);
console.log("md5 " + md5);
});
}
});
To Reproduce
I send a GET request to the image and Iโm getting the bytes of that image, then with my script Iโm trying to get the md5 of the image but when I calculate the MD5 with the terminal, I got a different MD5, I donโt know if this can be achieved with postman or Iโm doing something wrong.