jeudi 16 juillet 2020

Verify the test for json output in postman for arraylist

Have a json output without any message in it shown in image, also have valid list of userset. How to verify my test for user specific values only. As I want my test to verify if user is enabled and have ID or email.

Please see the screenshot for the outputjsontest

Test for users, enabled and role { "Status" : success, "Message" : "" , "user" : [ { "address" : { "city" : "newfiled" , "state" : "TX" , }, "mobile" : "8262772" , "contactId" : "6309053061" , "email" : "test@new.com" , "enabled" : true , "firstName" : "test" , "id" : "6hshe-726-4ecb-33ds2-7j267" , "organizations" : [ { "id" : "8588345063" , "name" : "TEST DATA COMPANY" } ], "phone" : "" , "roles" : {"Testers" : true , "Dev" : false }]}

declaring responsejson as variable. then tried, then need for roles too.

pm.test("testfordata",responsejson.users[0].enabled.is.equal(true); error: connot read property 'equal' of 'undefined'

Aucun commentaire:

Enregistrer un commentaire