When attempting to pass a value using the JSON Extractor feature in JMeter, I found that only the default value was successfully passed

My issue with passing the correct value from the JSON Extractor to the next call in my JMeter script may stem from an expression problem. https://i.stack.imgur.com/fFuw7.jpg

https://i.stack.imgur.com/JlG6q.jpg

This is how the Response JSON appears:

{"userAssociations":[{"id":"1","userAssociationRole":"ACCOUNTHOLDER","userAssociationMechanism":"USER-DATAENTRY","userAssociationStatus":"ACTIVE","accountHolderAssociationStatus":"ACTIVE","accountHolder":{"id":"2","givenName":"Perf","familyName":"Test1"},"issuer":{"id":"1","name":"A College","localeId":"en-US"}}],"operation":{"result":"OK","errors":[],"requestTimeStampUtc":"2017-09-27T21:32:59.327Z","responseTimeStampUtc":"2017-09-27T21:32:59.345Z"}}

The goal is to pass the second "id" = 2 from the JSON response to the URL of the subsequent call, but so far only the default value has been successfully passed as a variable.

Answer №1

Your JSON Path should always be specific:

$.userAssociations[0].accountHolder.id

Make sure the Match Number is set to 1

Check it here:

https://i.stack.imgur.com/hIyQX.png

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Converting a JSON object to a string in Java

I am working with a JSON file and looking to convert it from JSON to string using the org.simple.json library. { "header": { "IssuerID": "000141", "AuthenticationID": "e07020c0d040a050a0808099", "AuthenticationDateTime ...

Struggling to make json_encode function properly with input from database

Despite my efforts, I can't seem to get json_encode working properly for results retrieved from the fr column in my database. You can find an export of my table at mctrivia.com/language.zip. I have already switched everything to utf8mb4 as recommend ...

How come my Python script encounters UnicodeDecodeError in IntelliJ but runs without any issues when executed in the command line?

My program has a simple task of loading a .json file that includes a unique character. While the program runs smoothly in Terminal, I encounter an error in IntelliJ: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2 ...

Attempting to deserialize serialized data from Django using JSON.parse

I need assistance with some client-side tasks using Javascript. In my view, I serialize a Queryset from my models into JSON and pass it to the template. data = serializers.serialize("json", Profile.objects.filter(user_id=self.request.user)) This results ...

Unable to transform it into the specified content-type of application/json

let formData = new FormData(); formData.append('_token', vm.response._token); formData.append('file', vm.response.content[i].path); formData.append('type', vm.respons ...

What is the best location to place the code responsible for fetching data with NSURLRequest?

As I venture into the world of developing my first iPhone app, one that fetches JSON data and displays it in UITableView, I find myself pondering a crucial question. Where is the ideal spot in my code to place the NSURLRequest? In my quest for answers, I& ...

What causes the parameter to be null when jQuery AJAX sends Content-Type=application/json to an MVC Controller Action method?

Apologies for asking a question that has been addressed multiple times before, but I am unsure if the answers from those discussions are still relevant with the latest versions of ASP.NET Core MVC and jQuery. My MVC controller method accepts a class objec ...

NextJS - Error: Invalid JSON format, starting with a "<" symbol at position 0

After following a tutorial on NextJS, I attempted to make some modifications. My goal was to include the data.json file on the page. However, I kept encountering the error message "Unexpected token < in JSON at position 0." I understand that I need to con ...

What steps should be taken to modify an image following retrieval of data from the database?

When using the function getDataFromDb(), I am trying to retrieve the latest data from the database. Specifically, I want to use val["id"] as a condition to determine which image to display in the function GetImage. However, my attempts have not been succ ...

What is the process for extracting information from JSON data that is not in

Attempting to extract data from a local .json file by utilizing StreamReader and Json.NET. The json content and code snippet are as follows: Contents of .json file: {"rate":50,"information":{"height":70,"ssn":43,"name":"andrew"}} using (v ...

When trying to convert to JSON in node, the process fails. However, the data can still be

I am currently working on converting an array to JSON in order to send it to a client. The data I see in the console is as follows: [ NL: [ true, true, true, true, true, true, true, true, true, true, true, true ], ...

Transform a CSV file into a JSON object containing arrays of numbers

Feeling a bit stuck on this one - any guidance would be greatly appreciated! Using primarily an online converter, or perhaps even a node package, I am attempting to transform a CSV file structured like so: Cat,31.2,31.2 Dog,35,1 Tree,32.4 into the follo ...

Something went wrong while attempting to decode JSON in Python due to a missing comma delimiter

How can I send JSON data using sockets in Python? {"receiver": "2", "sender:": 1, "seq_num": 10, "data": "{"iv": "jdjhvwGriJ95kZwgDWlShw==", "ciphertext": "Fg7ugYYAn ...

Exploring JSON Data with Mustache Templates

Dealing with a significantly large JSON object that I can't control, I'm struggling to output a list of records (related to people in this case) using Mustache.js. Despite simplifying the complex object into a more manageable one with just the ne ...

Are Json.load operations considered inefficient?

While browsing through the json module's source code in search of an answer to another question, I stumbled upon something quite intriguing. After removing the docstring and various keyword arguments, the essence of json.load is revealed as follows: ...

Utilizing Google Fonts offline without the need for an API

Instead of relying on Google Fonts API to access a variety of fonts for my website, I took matters into my own hands. I downloaded a snapshot of fonts from this GitHub repository: https://github.com/google/fonts and transferred them to my web directory. T ...

Utilizing Jayway Implementation for Grouping Predicates in JSON Path

Trying to utilize JSONpath for querying my JSON Object. The logical || or && operator is functioning correctly individually. However, when attempting to group predicates together and then perform the logical || or && operations, it appears not to be workin ...

Deciphering a JSON Array in JavaScript to extract specific components

I have a brief snippet for a JSON array and a JavaScript function that currently returns a single argument: <!DOCTYPE html> <html> <body> <h2>JSON Array Test</h2> <p id="outputid"></p> <script> var arrayi ...

Express.js Server Side Rendering - GET request for '/json/version/'

I have a running express server that pre-renders my react application. The routes file matches the HomeContainer to the base route / and all other routes match to the page not found. import HomeContainer from 'containers/home-container/home-container ...

Populate dropdown list dynamically in Codeigniter using AJAX and jQuery

Although this question may appear to be a duplicate, none of the other answers provided have solved my issue. My query pertains to populating a dropdown using ajax/jquery. While I can successfully send and receive data in JSON format, it doesn't seem ...