How To use JSON Extractor in Jmeter
Json extractor is used like regular expression extractor to capture some dynamic values from the response but used for json only.
By using this we can fetch the values of variables in the Json.
Let me take an example
Below is the Json and its corresponding response:
Here we want to extract the value of variable name "label" or "val"
which are changing dynamically
We can use Json extractor to fulfil thie purpose here
below is the JSON values that can be used
In this Json extractor blow are the parameters and their corresponding values
Variable Name: Name of the variable (can be used anything logical, here we have used the same as we are getting in response)
JSON Path expression: It is the most important part for JSON configurations, We should use the path extractor expression here.
Here we have used $..lable , Here two dot means we have json variable in two nested blocks, For normal JSON where there is only one tag , we used single dot.
Match Number: 0 means any random value, here we can use 1 or 2 to get first value or second value and so on, we can also use -1 for getting all possible values to be stored in array (with variable name as mentioned above)
Default Values: this values that can be passed when we didnt got the expected value.
TO varify the value captured in Json extractor:
We can use the Debug Sampler on the thread group to validate the value captured using Json extarctor, Debug sample is used to print all the used defined configured variable in jmeter.
Here we can see that variable "label": captured SpiceJet , and lable_matchNr having value as 10 because there are 10 occurrence of the values corresponding to the expression we have defined for variable label in JSON extractor.
Feel Free to add if i have missed anything.
Json extractor is used like regular expression extractor to capture some dynamic values from the response but used for json only.
By using this we can fetch the values of variables in the Json.
Let me take an example
Below is the Json and its corresponding response:
Here we want to extract the value of variable name "label" or "val"
which are changing dynamically
We can use Json extractor to fulfil thie purpose here
below is the JSON values that can be used
In this Json extractor blow are the parameters and their corresponding values
Variable Name: Name of the variable (can be used anything logical, here we have used the same as we are getting in response)
JSON Path expression: It is the most important part for JSON configurations, We should use the path extractor expression here.
Here we have used $..lable , Here two dot means we have json variable in two nested blocks, For normal JSON where there is only one tag , we used single dot.
Match Number: 0 means any random value, here we can use 1 or 2 to get first value or second value and so on, we can also use -1 for getting all possible values to be stored in array (with variable name as mentioned above)
Default Values: this values that can be passed when we didnt got the expected value.
TO varify the value captured in Json extractor:
We can use the Debug Sampler on the thread group to validate the value captured using Json extarctor, Debug sample is used to print all the used defined configured variable in jmeter.
Here we can see that variable "label": captured SpiceJet , and lable_matchNr having value as 10 because there are 10 occurrence of the values corresponding to the expression we have defined for variable label in JSON extractor.
Feel Free to add if i have missed anything.
I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
ReplyDeleteUNIX / LINUX TRAINING IN CHENNAI | BEST UNIX/ LINUX TRAINING IN CHENNAI
C/C++ TRAINING IN CHENNAI | BEST UNIX / LINUX TRAINING IN CHENNAI
IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.
DeleteIEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.
corporate training in chennai corporate training in chennai
corporate training companies in india corporate training companies in india
corporate training companies in chennai corporate training companies in chennai
I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai
pinatamasters mod apk
ReplyDelete
ReplyDeleteمكافحة حشرات بالخبر افضل شركة مكافحة حشرات بالخبر
مكافحة حشرات بمكة افضل شركة رش حشرات بمكة
مكافحة حشرات بالمدينة المنورة افضل شركة رش حشرات بالمدينة المنورة
مكافحة حشرات بالدمام افضل شركة مكافحة حشرات بالدمام
This is fundamentally the same as the old showcasing procedure of getting somebody on your mailing list. best email spider
ReplyDeleteAmazing Article,Really useful information to all So, I hope you will share more information to be check and share here.
ReplyDeleteinternship in chennai for electrical engineering students
one month internship in chennai
vlsi internship in chennai
unpaid internship in chennai
internship for hr in chennai
internship training chennai
internship for freshers in chennai
internship in chennai for it students with stipend
internship in accenture chennai
naukri internship in chennai
Public statements are frequently sent to the forthcoming clients through emails. Bulk Email Sender
ReplyDeleteThis content is written very well. Your use of formatting when making your points makes your observations very clear and easy to understand. Thank you. targeted email extractor
ReplyDeleteFire Damage Restoration Services in Sacramento CA systems that keep our home comfortable all year long. Maintenance plays a key role in ensuring that our cooling system stays running smoothly and save our investment.
ReplyDelete