mardi 8 octobre 2019

How do i check if certain value is a string using Postman

I am trying to access a values inside keys using Postman and test what type of value it. The format i receive is Json and it is an array of few Json objects with the same Key and i am trying to test if the value matches the format ( for example if the value of a key is a string or int or...)

[
    {
        "id": 1,
        "accountNo": "1234567891234567",
        "companyCode": "Test",
        "apiKey": null,
        "name": "Test",
        "channel": "SFTP",
        "levelOne": 1,
        "levelTwo": 1,
        "levelThree": 1,
        "templateName": null,
        "codeFormat": "testni",
        "isAmountChangeAllowed": true,
        "isActive": false,
        "phoneNumber": "123456789",
        "email": "test@test.com",
        "pdfFileUrl": "/app/",
        "interval": 0,
        "day": 0
    },
    {
        "id": 4,
        "accountNo": "54345",
        "companyCode": "TEST",
        "apiKey": null,
        "name": "Testno Name",
        "channel": "SFTP",
        "levelOne": 1,
        "levelTwo": 1,
        "levelThree": 1,
        "templateName": null,
        "codeFormat": "testno",
        "isAmountChangeAllowed": true,
        "isActive": true,
        "phoneNumber": "312",
        "email": "test@test.com",
        "pdfFileUrl": "/app/op",
        "interval": 2,
        "day": 5
    },

Error message i get is "AssertionError: expected undefined to deeply equal 5"

Aucun commentaire:

Enregistrer un commentaire