Contributions
SOAPUI Script Assertion: Identical values failing assert
While trying to test a REST API I am trying to compare a value in a response with a previous value stored in a separate testCase. Using script assertion, I am getting the proper values and they are identical, but when I try to match them using an assert it fails. Any clue as to why this is happening and how I can resolve it?Solved1.6KViews0likes3CommentsContains Assert to match Regex in JSON Response
I am new to SuapUI and I am trying to use the Contains assert to verify that a certain string exists in a response. I know I can match the value I am looking for with a JSONPath match ($.data[0].ratu_desc), but the value might not always be in the same position (0). I merely want to verify that the string"ratu_desc": "Total Canada" exists in the response. What regex should I use? Even when I go to the online regex testers to test my regex pattern, when I paste the pattern into the Contains box it matches nothing. My JSON response: { "data": [ { "ratu_id": 247796211, "ratu_desc": "Total Canada", "ratu_code": "CAN", "ratu_isarchived": 0, "ratu_ratm_id": 247795404, "ratu_ratm_id_lookup": "Audience", "ratu_slu_id_markettype": 124330, "ratu_slu_id_markettype_lookup": "Uses Market Allocation Methods", "ratu_slu_id_estimatetype": null, "ratu_slu_id_estimatetype_lookup": null }, { "ratu_id": 257213831, "ratu_desc": "SQA Universe", "ratu_code": "SQUNV", "ratu_isarchived": 0, "ratu_ratm_id": 247795993, "ratu_ratm_id_lookup": "Edmonton EM", "ratu_slu_id_markettype": 124320, "ratu_slu_id_markettype_lookup": "Has Market Level estimates", "ratu_slu_id_estimatetype": null, "ratu_slu_id_estimatetype_lookup": null }, ], "error": null, "bvError": null }1.7KViews0likes4Comments