vendredi 22 mai 2020

Postman Script if else condition for null values

I was trying to use if else to access [ ] condition

    var jsonData = pm.response.json();
    if (jsonData === null) {
        console.log('1');
        postman.setNextRequest("Get Count");
    }
    else {
        console.log('2');
        postman.setNextRequest("Create");
}
})

enter image description here

"I want Condition when empty should print 1"

but my response is getting

enter image description here

Aucun commentaire:

Enregistrer un commentaire