Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

In Jmeter, How to extract value from the variable having JSON data

I am getting following response in one GET API call.

{
  "id": 78929,
  "created": "04-12-2021 02:37:52",
  "modified": "04-12-2021 02:37:52",
  "name": "Applebee",
  "url": "https://applebee-2.prashant.com",
  "key1": "vp_9d254bb754ab6283afa9ecf0f0847b5a",
  "interval2": 120,
  "tenant_id": 60895,
  "channel_id": 2,
  "channel_type": "platform",
  "warehouse_id": 54533,
  "warehouse_name": "Bedfordview Warehouse",
  "stock_policy": "CUSTOM",
  "currency_id": 45396,
  "order_from_date": "2021-10-03 02:36:48",
  "inventory_update": true,
  "order_update": true,
  "price_update": true,
  "active": true,
  "resync": true,
  "last_access_record_id": 89880,
  "last_accessed_record": {
    "id": 89880,
    "last_order_to_date": "2021-12-07T00:16:39.000+0000",
    "last_order_id": "0",
    "last_order_page": 1
  },
  "store_config": "{\"isOrderUpdateProcessor\":false,\"auto_archive\":true,\"tagOrderRisks\":true,\"error_emails\":\"kyle@gmail.com\",\"autoMapDuplicateProduct\":true,\"enabledMultiCurrency\":false,\"disableSyncPIIData\":false}",
  "last_inventory_sync": "04-12-2021 02:43:35",
  "inventory_sync_interval": 1440,
  "stock_policy_warehouse_ids": [
    {
      "id": 53543,
      "created": "04-12-2021 02:37:52",
      "modified": "04-12-2021 02:37:52",
      "store_id": 78929,
      "external_warehouse_id": "34639577171",
      "warehouse_id": 54533,
      "add_qty_value": "0%",
      "add_incoming_qty_value": "0%",
      "tenant_id": 60895
    },
    {
      "id": 53544,
      "created": "04-12-2021 02:37:52",
      "modified": "04-12-2021 02:37:52",
      "store_id": 78929,
      "external_warehouse_id": "60921610323",
      "warehouse_id": 54534,
      "add_qty_value": "0%",
      "add_incoming_qty_value": "0%",
      "tenant_id": 60895
    }
  ],
  "old_shopify_locations": [
    {
      "id": "60921610323",
      "name": "Supplier",
      "warehouseId": 54534,
      "warehouseName": "Lux"
    },
    {
      "id": "34639577171",
      "name": "Bedfordview Warehouse",
      "warehouseId": 54533,
      "warehouseName": "Bedfordview Warehouse"
    }
  ]
}

I have added following JSON Extractor to fetch store_config value from the above API response.

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So as per above example, I am getting following store_config value via JSON Extractor.

{
  "isOrderUpdateProcessor": false,
  "auto_archive": true,
  "tagOrderRisks": true,
  "error_emails": "kyle@gmail.com",
  "autoMapDuplicateProduct": true,
  "enabledMultiCurrency": false,
  "disableSyncPIIData": false
}

So Now, I want to fetch "isOrderUpdateProcessor" value from the above store_config varible.

So please help me into this.

>Solution :

If you want to extract isOrderUpdateProcessor from the result

  1. Add a JSON Extractor just below you JSON extractor
  2. Configure the JSON Extractor to extract the value isOrderUpdateProcessor from the JMeter variable store_config

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading