Contributions
Re: JSONPath Existence Match always returns true
Just to add a clarification: Even If I change theexpression in assertionfrom $.ApplicationResult.HotelList[?(@.HotelId==${#TestSuite#hotelId})] $.ApplicationResult.HotelList[?(@.HotelId==${#TestSuite#xyz})] it still evaluates to true, although there is even no TestSuitevariable "xyz".2.4KViews0likes0CommentsRe: JSONPath Existence Match always returns true
{ "Result": { "ResultCode": "SUCCESS" }, "ApplicationResult": { "HotelList": [{ "HotelId": "67194", "HotelName": "Jemi1 Hotel VA", "HotelCode": "Jemi1 HOTEL", "CRO": { "Id": "17687", "ChainId": "17686", "Name": "JJT CRO" }, "Location": { "Address": { "AddressLine": "123 Campus circle", "City": "Los Angeles", "StateProvCode": "CA", "StateProv": "California", "CountryCode": "US", "CountryName": "United States", "Latitude": 34.05223, "Longitude": -118.24368 }, "ContactNumberList": [{ "Number": "3104676226" }], "TimeZone": "-0600", "Airport": { "Name": "Dallas Area" }, "TimeZoneOffset": "-6" }, "ActiveStartDate": "16-May-16", "ActiveEndDate": "N/A", "Terminated": "false", "Suspended": "false", "AvailStatus": "Available", "WeatherCityId": "5368361", "Brand": { "Id": "8000554", "Name": "JEM Brand2", "Default": true, "Code": "JEM Brand2" }, "Brands": [{ "Id": "8000553", "Name": "JEM Brand1", "Default": false, "Code": "JEM Brand1" }, { "Id": "8000554", "Name": "JEM Brand2", "Default": true, "Code": "JEM Brand2" }] }, { "HotelId": "50916", "HotelName": "Chris K ARI Test Hotel - AutoClerK", "HotelCode": "CJKHOTEL05", "CRO": { "Id": "17687", "ChainId": "17686", "Name": "JJT CRO" }, "Location": { "Address": { "AddressLine": "111 Main st", "City": "Newton", "StateProvCode": "MA", "StateProv": "Massachusetts", "PostalCode": "02458", "CountryCode": "US", "CountryName": "United States", "Latitude": 0, "Longitude": 0 }, "ContactNumberList": [{ "Number": "617 454 6989" }], "TimeZone": "-0500", "Airport": {}, "TimeZoneOffset": "-5", "DISTANCE": 4886.105 }, "ActiveStartDate": "30-Mar-11", "ActiveEndDate": "N/A", "Terminated": "false", "Suspended": "false", "AvailStatus": "Available", "WeatherCityId": "5101848" }, { "HotelId": "67204", "HotelName": "Jemi6 Hotel", "HotelCode": "Jemi6 Hotel", "CRO": { "Id": "17687", "ChainId": "17686", "Name": "JJT CRO" }, "Location": { "Address": { "AddressLine": "116 Walter Blvd", "City": "Los Angeles", "StateProvCode": "ESX", "StateProv": "East Sussex", "CountryCode": "GB", "CountryName": "United Kingdom", "Latitude": 39.668903, "Longitude": -74.22333 }, "ContactNumberList": [{ "Number": "31000000" }], "TimeZone": "-0600", "Airport": {}, "TimeZoneOffset": "-6", "DISTANCE": 7795.3257 }, "ActiveStartDate": "18-May-16", "ActiveEndDate": "N/A", "Terminated": "false", "Suspended": "false", "AvailStatus": "Available", "Brand": { "Id": "8000553", "Name": "JEM Brand1", "Default": true, "Code": "JEM Brand1" }, "Brands": [{ "Id": "8000553", "Name": "JEM Brand1", "Default": true, "Code": "JEM Brand1" }, { "Id": "8000554", "Name": "JEM Brand2", "Default": false, "Code": "JEM Brand2" }, { "Id": "8000575", "Name": "JEM Brand4", "Default": false, "Code": "JEM Brand4" }] }], "Paging": { "Start": 1, "Size": 3, "Total": 7 } } }2.4KViews0likes2CommentsJSONPath Existence Match always returns true
Hello, Iam usingJSONPath Existence Match Assertion on an array and I noticed that it always evaluates to true. This is my expression and no matter which custom property Iuse inside the condition, the result always evaluates to true. $.ApplicationResult.HotelList[?(@.HotelId==${#TestSuite#hotelIId})] I'm using SOAPUI 5.4.0. Thanks!Solved2.5KViews0likes4Comments