Closed parthvyas88 closed 5 years ago
Plain text path:
String response body entries 0 API Bhagavad Gita
Note list indices - always start from zero.
JSONPath (one of many possible, remember this helped me initially: http://jsonpath.com/)
String $[0].API Bhagavad Gita
Hope this helps to get started.
Thanks!! I had missed the 0 part. However upon using this syntax, I get the value but still not able to validate
Robot Statement: String response body entries 0 API Bhagvad Gita
Error : 20181129 00:30:25.798 : FAIL : u'Bhagavad Gita' is not one of [u'Bhagvad Gita']
Failed validating u'enum' in schema: {u'enum': [u"'Bhagvad Gita'"], 'type': u'string'}
On instance: u'Bhagavad Gita' Ending test: RESTAPI.PublicApi.Validate Request
For me it seems you are mistyping the name. 👍
{ "seconds": 0.085585, "status": 200, "body": { "count": 6, "entries": [ { "Category": "Books", "Description": "Bhagavad Gita text", "Auth": "OAuth", "API": "Bhagavad Gita", "Link": "https://bhagavadgita.io/api", "HTTPS": true, "Cors": "yes" }, { "Category": "Books", "Description": "Books published in the Netherlands and Flanders (about 2.5 million), book covers and related data", "Auth": "", "API": "BookNomads", "Link": "https://www.booknomads.com/dev", "HTTPS": true, "Cors": "unknown" }, { "Category": "Books", "Description": "Books", "Auth": "apiKey", "API": "Goodreads", "Link": "https://www.goodreads.com/api", "HTTPS": true, "Cors": "unknown" }, { "Category": "Books", "Description": "Books", "Auth": "OAuth", "API": "Google Books", "Link": "https://developers.google.com/books/", "HTTPS": true, "Cors": "unknown" }, { "Category": "Books", "Description": "Books, book covers and related data", "Auth": "", "API": "Open Library", "Link": "https://openlibrary.org/developers/api", "HTTPS": true, "Cors": "unknown" },] } }
I want to fetch data e.g. below Robot script String response body entries[0] API Bhagavad Gita