API Automation jsonpath node issue
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
API Automation jsonpath node issue
Hi All
SOAPUI PRO
API response has
[ { "username": "xyz", "password": "1234",
},
{ "username": "null", "password": "12344", },
{ "username": "AB1", "password": "123411", },
{ "username": "null", "password": "1234111", },
{ "username": "null", "password": "123",
} ]
Json node
JSON
• 0
• 1
• 2
• 3
• 4
Now am trying to get the username from all the record which should not null
$.[*].[?(@.username)] And $..[?(@.username)]
Both assertion is not working
Guide me if u have a solution
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your JSON is not valid -- it has extra commas before }. Assuming these are just typos, the following should work:
$[?(@.username != "null")].username
Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bro,
Extra commas before }. is not a typo error. that the way getting the response.
I tired with the below assertion
$[?(@.username != "null")].username
It's not working.. any other way to fix this issue
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bro,
ur right it's a typo error. thanks for the information and great support
