What does count at the end of response mean in Postman? - testing

I am starting out with Postman. I made a simple GET request and got a response. At the end of the response, is "count=14". I am trying to understand what count means here?
I thought the number of records in the response is 14, but its only 10. So what does count=14 mean? Thankyou for your response!
This is the response I got:
{
"records": [
{
"id": "074df210-e1fb-4298-9407-d97881dc1af2",
"fullName": "Abcd",
"email": "janedoe#gmail.com",
"phone": "112-112-112"
},
{
"id": "4f0835d7-7c02-43da-86c7-77a03b4",
"fullName": "John Doe",
"email": "johndoe#gmail.com",
"phone": "1234-234"
},
{
"id": "a9e8cfb6-f62a-4a8e-84a5-df30",
"fullName": "Kitty Doe",
"email": "kittydoe#gmail.com",
"phone": "123-493-892"
},
{
"id": "319bdb34-e1c1-4e86-192",
"fullName": "Lovely Doe",
"email": "lovelydoe#gmail.com",
"phone": "089-829-3898"
},
{
"id": "1dfe5bba-e14b-4e9d-b90c",
"fullName": "Memory Doe",
"email": "memorydoe#gmail.com",
"phone": "273-872-8398"
},
{
"id": "61f466d5-ec00-76ccb88fff5e",
"fullName": "asdas",
"email": "asdas#gmail.com",
"phone": "123-123-9231"
},
{
"id": "f77b8e1d-70f2-4d44-b243-e61eac2a41a0",
"fullName": "asdasda",
"email": "asdasda#gmail.com",
"phone": "123-123-1291"
},
{
"id": "7d071c9e-fce6-4732-bed3-c18412a962c1",
"fullName": "Monday",
"email": "monday#gmail.com",
"phone": "123-129-1231"
},
{
"id": "5a1d1e9d-7396-41e3-aa96-864b",
"fullName": "Tuesday",
"email": "tuesday#gmail.com",
"phone": "123-241-2534"
},
{
"id": "f5da56d1-9fc2861e6da3",
"fullName": "Wednesday",
"email": "wednesday#gmail.com",
"phone": "129-121-1212"
}
],
"count": 14
}

Related

When using the Quickbooks API explorer, read a vendor endpoint returns additional fields. How do I get these fields in actual API results?

Response from API via API explorer(by Intuit)
{
"Vendor": {
"BillAddr": {
"Id": "9",
"Line1": "31/2-34/2B, G01, Ground Floor (P V Enclave, V-Step Road)",
"Line2": "Kempapura",
"City": "Bangalore",
"Country": "India",
"CountrySubDivisionCode": "karnataka",
"PostalCode": "560037"
},
"BusinessNumber": "ABPFA3772K",
"Balance": 12960,
"BillRate": 0,
"Vendor1099": false,
"CurrencyRef": {
"value": "INR",
"name": "Indian Rupee"
},
"TDSEnabled": true,
"TDSEntityTypeId": 2,
"TDSSectionTypeId": 20,
"TDSOverrideThreshold": false,
"GSTIN": "29ABPFA3772K1ZT",
"GSTRegistrationType": "GST_REG_REG",
"CostRate": 0,
"domain": "QBO",
"sparse": false,
"Id": "5",
"SyncToken": "3",
"MetaData": {
"CreateTime": "2021-11-29T04:13:02-08:00",
"LastUpdatedTime": "2022-06-19T11:18:01-07:00"
},
"CompanyName": "Asyncauto",
"DisplayName": "Asyncauto",
"PrintOnCheckName": "Asyncauto",
"Active": true,
"V4IDPseudonym": "002085e0c7fca007484293913d58943f84b215",
"PrimaryPhone": {
"FreeFormNumber": "1231231234"
},
"PrimaryEmailAddr": {
"Address": "123123#mralbert.in"
}
},
"time": "2022-06-19T19:00:23.349-07:00"
}
Response from the actual API endpoint (quickbooks.api.intuit.com)
{
"Vendor": {
"BillAddr": {
"Id": "9",
"Line1": "31/2-34/2B, G01, Ground Floor (P V Enclave, V-Step Road)",
"Line2": "Kempapura",
"City": "Bangalore",
"Country": "India",
"CountrySubDivisionCode": "karnataka",
"PostalCode": "560037"
},
"BusinessNumber": "ABPFA3772K",
"Balance": 12960.00,
"Vendor1099": false,
"CurrencyRef": {
"value": "INR",
"name": "Indian Rupee"
},
"domain": "QBO",
"sparse": false,
"Id": "5",
"SyncToken": "3",
"MetaData": {
"CreateTime": "2021-11-29T04:13:02-08:00",
"LastUpdatedTime": "2022-06-19T11:18:01-07:00"
},
"CompanyName": "Asyncauto",
"DisplayName": "Asyncauto",
"PrintOnCheckName": "Asyncauto",
"Active": true,
"PrimaryPhone": {
"FreeFormNumber": "1231231234"
},
"PrimaryEmailAddr": {
"Address": "123123#mralbert.in"
}
},
"time": "2022-06-19T19:04:59.703-07:00"
}
Notice that in the second case these fields - "TDSEnabled","TDSEntityTypeId","TDSSectionTypeId","TDSOverrideThreshold","GSTIN","GSTRegistrationType", are missing.
How do I get these fields in the regular production endpoint?
Try using Postman and see if issue persist then you need to talk with quickbooks support.
I have found that in indian edition of quickbooks still has many issue open.

Karate assertions for dynamic response

Response Actual:
{
"data": [
{
"last_name": "Bluth",
"id": 1,
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/calebogden/128.jpg",
"first_name": "George",
"email": "george.bluth#reqres.in"
},
{
"last_name": "Weaver",
"id": 2,
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/josephstein/128.jpg",
"first_name": "Janet",
"email": "janet.weaver#reqres.in"
}
]
}
I have a Database object where it return array of first_name's
Expected:
{"George","Janet"}
I am using scenario outline here as i have bunch of tests need to be check and output is dynamic. How can we write the assertions for this type of scenarios ???
something like response.data[].first_name == expected ??
Sample Code:
Feature: Array Match
Scenario:
* def act =
"""
{
"per_page": 6,
"total": 12,
"ad": {
"company": "StatusCode Weekly",
"text": "A weekly newsletter focusing on software development, infrastructure, the server, performance, and the stack end of things.",
"url": "http://statuscode.org/"
},
"data": [
{
"last_name": "Bluth",
"id": 1,
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/calebogden/128.jpg",
"first_name": "George",
"email": "george.bluth#reqres.in"
},
{
"last_name": "Weaver",
"id": 2,
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/josephstein/128.jpg",
"first_name": "Janet",
"email": "janet.weaver#reqres.in"
},
{
"last_name": "Wong",
"id": 3,
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/olegpogodaev/128.jpg",
"first_name": "Emma",
"email": "emma.wong#reqres.in"
},
{
"last_name": "Holt",
"id": 4,
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/marcoramires/128.jpg",
"first_name": "Eve",
"email": "eve.holt#reqres.in"
},
{
"last_name": "Morris",
"id": 5,
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/stephenmoon/128.jpg",
"first_name": "Charles",
"email": "charles.morris#reqres.in"
},
{
"last_name": "Ramos",
"id": 6,
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/bigmancho/128.jpg",
"first_name": "Tracey",
"email": "tracey.ramos#reqres.in"
}
],
"page": 1,
"total_pages": 2
}
"""
* def exp = ["George","Janet","Emma","Eve","Charles","Tracey"]
* match $act.data[*].first_name == exp
Reference Link: https://github.com/intuit/karate#get-short-cut

Scenario Outline in Karate for multi-line JSON

How to use scenario outline to iterate for a JSON which is more than single cell
https://github.com/intuit/karate#the-cucumber-way
Data.json
[{
"address": {
"addressLine1": "ttes",
"addressLine2": "Test",
"addressLine3": "Test",
"addressType": "business",
"city": "TEST",
"company": "TEST",
"country": "TEST",
"state": "TEST",
"postalCode": "XXXX"
},
"name": {
"firstName": "TEST",
"lastName": "TEST",
"middleInit": "T",
"title": "Mr."
},
"phone": {
"phoneExtension": "1234",
"phoneNumber": "999999999",
"phoneType": "mobile"
},
"email": {
"emailAddress": "TEST#TEST.com"
}
},
{
"address": {
"addressLine1": "ttes1",
"addressLine2": "Test1",
"addressLine3": "Test1",
"addressType": "business",
"city": "TEST1",
"company": "TEST1",
"country": "TEST1",
"state": "TEST1",
"postalCode": "XXXX"
},
"name": {
"firstName": "TEST1",
"lastName": "TEST1",
"middleInit": "T",
"title": "Mr."
},
"phone": {
"phoneExtension": "1234",
"phoneNumber": "999999999",
"phoneType": "mobile"
},
"email": {
"emailAddress": "TEST#TEST1.com"
}
}]
====
Feature: Read from File
Background:
* def Testdata = read('Data.json')
Scenario Outline: [1] Test with multiple records on JSON
Given url_stg
And path 'test','test'
And request Testdata
When method POST
Examples:
|Testdata |
Please refer it in this documentation as it very straight forward for your case.
dynamic-scenario-outline
refer to this answer for different ways of providing data to Scenario Outline:
https://stackoverflow.com/a/56135752/8615449

Using Groovy in soapUI to extract a JSON field

I am using soapui with groovy for automation api test and I post a request REST, here is my response:
{`enter code here`
"firstname": "aaa",
"lastname": "bbb",
"address": "test",
"city": "city",
"country": "country",
"default": "false",
"id": "326"
}, {
"firstname": "ddd",
"lastname": "eee",
"address": "test",
"city": "city",
"country": "country",
"default": "True",
"id": "67"
}, {
"firstname": "hhh",
"lastname": "yyy",
"address": "test",
"city": "city",
"country": "country",
"default": "false",
"id": "345"
}, {
"firstname": "ooo",
"lastname": "hh",
"address": "test",
"city": "city",
"country": "country",
"default": "false",
"id": "3211"
},
I want to recover the id of the user who has a default "true"
Firstly, the response you posted is not valid json.
Should be something like this:
[
{
"firstname": "aaa",
"lastname": "bbb",
"address": "test",
"city": "city",
"country": "country",
"default": "false",
"id": "326"
},
{
"firstname": "ddd",
"lastname": "eee",
"address": "test",
"city": "city",
"country": "country",
"default": "True",
"id": "67"
},
{
"firstname": "hhh",
"lastname": "yyy",
"address": "test",
"city": "city",
"country": "country",
"default": "false",
"id": "345"
},
{
"firstname": "ooo",
"lastname": "hh",
"address": "test",
"city": "city",
"country": "country",
"default": "false",
"id": "3211"
}
]
If you're just interested in the groovy script, here it is:
package json
import com.eviware.soapui.support.XmlHolder
import groovy.json.*
//define the location of the JSON response
def response = context.expand('${post_json_data#Response}').toString()
//parse response as json
def json_response = new JsonSlurper().parseText(response)
//iterate on the list with if condition
json_response.eachWithIndex {
item, index ->
if(item.default == 'True') {
log.info "index: ${index}"
log.info "Item default value: ${item.default}"
log.info "Item id value : ${item.id}"
}
}

pentaho Error 64k limit in JSON FileInput

I created a job which extracts json datas from a webservice. It works on my PC but not when I export it on my dev. server (Ubuntu Server x64). please help me on this.
ERROR
"Caused by: sun.org.mozilla.javascript.EvaluatorException: Encountered
code generation error while compiling script: generated bytecode for
method exceeds 64K limit. (#1)"
JSON format
"[{
"firstName": "John",
"lastName": "Smith",
"age": 25,
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": xxxxx
},
"phoneNumber": [
{
"type": "home",
"number": "xxx xxx-xxxx"
},
{
"type": "fax",
"number": "xxx xxx-xxxx"
}
]
},
{
"firstName": "John",
"lastName": "david",
"age": 28,
"address": {
"streetAddress": "23 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": xxxxx
},
"phoneNumber": [
{
"type": "home",
"number": "xxx xxx-xxxx"
},
{
"type": "fax",
"number": "xxx xxx-xxxx"
}
]
},
{
"firstName": "Jondy",
"lastName": "rodes",
"age": 25,
"address": {
"streetAddress": "21 2nd Street",
"city": "Kenucky",
"state": "KY",
"postalCode": xxxxx
},
"phoneNumber": [
{
"type": "home",
"number": "xxx xxx-xxxx"
},
{
"type": "fax",
"number": "xxx xxx-xxxx"
}
]
}]"
See this forum post here:
http://forums.pentaho.com/showthread.php?89304-Job-runs-fine-in-Spoon-but-not-in-Kettle-Exceeds-64K-in-Json-Input-step
The suggestion seems to be to use the javascript step then turn off the optimisation option.
64k limit problem with jvm lower versions. Upgrade your java to 1.7 version. Problem will be solve.