Contributions
JSON - check for a specific response
Hi all, I am after a simple assertion to check that a specific parameter "status" has produced the word "COMPLETED". NMRAO helped me out a few weeks back with a script that checked if "id" produced a number. This works well but I can't modify it to check "status". Below is part of the expected response from SOAP: --------------------------------------- {"wf_job_group": { "blotter_id": null, "complete_date": null, "complete_time": null, "status":COMPLETED }, "portfolio_id": null, "priority": "1", -------------------------------------------- I need an Assertion to check if status does = COMPLETED ...... if YES then pass. Any help appreciated. Regards845Views0likes1CommentRe: script assertion
Thanks Rao, below is what is returned after running the test: { "CONTENT": { "FILTERS": [], "asset_id": null, "asset_subtype": "xxxxxx", "asset_type": "xxxxxxx", "cost_multiplier": 0, "created_date": 20170602, "created_time": 153701, "effective_date": 20201123, "expiry_date": 20221101, "id": 114, }, "message": "Modifier successfully saved.", "modifier_id": 114, "status": "OK" } Associated with this test are2 simple assertions: 1. Valid HTTP Status Code 2. JsonPath ExistenceMatch---- here I just check ID exists; which it does -114 It is the ID I am most interested in but knowing that ID is there is kind of pointless if I cannot check that a value has been created for it. I can make an error with the input so and ID result is not created but the assertion would still be valid- ID would still be there but empty. I need to check that a value has been produced- it could be 1 or 99999999 so long as an ID value has been produced. I did look at your link but I simply do not understand enough to apply it in an useable way. Regards4.8KViews0likes5Commentsscript assertion
Hi, not being a programmer could anyone suggest a way to check if the property "apples" has a number rather than just null for example. So below is the result of running a test. I can easily ask SOAP to check if there is an item called "apples" but I have no idea how to ask if "apples" equals a numerical value- any value not just 111. { "CONTENT": { "apples": 111, }, .......in my own language.... I have a test in SOAP- one element of that test = "apples". I want to add a SCRIPT Assertion that checks that the test has created a Value for "apples" and not just a blank or "0". thanks in advance .....almost total non-programmerSolved4.8KViews0likes7Comments- 2.8KViews0likes0Comments
script assertion
Hi, not being a programmer could anyone suggest a way to check if the property "apples" has a number rather than just null for example. So below is the result of running a test. I can easilyask SOAP to check if there is an item called "apples" but I have no idea how to ask if "apples"equals a numerical value- any value not just 111. { "CONTENT": { "apples": 111, }, thanksSolved2.9KViews0likes6Comments