Reputation: 69
As i am new to webservice in jmeter ,I am not understand how to move ahead in this, I have a json response like below,How can i put assertion for the below...
{
"flightDetails": [
{
"outBoundFlights": [
{
"flightInfo": {
"departureCity": "Bengaluru, , IN - Kempegowda International Airport",
"departureDateAndTime": "2017-04-24T17:00:00",
"arrivalCity": "Newark, NJ, US - Newark Liberty Intl Arpt",
"arrivalDateAndTime": "2017-04-25T07:55:00",
"numberOfStops": 1,
"individualPricing": [
{
"passengerType": 1,
"totalTaxFeePerPaxType": 626.55,
"totalTaxAmountPerPaxType": 461.55,
"baseFareAmountPerPaxType": 165.0,
"taxandFee": {
"markup": 6.6,
"merchantFee": 40.99,
"supplierTax": 410.96
Upvotes: 0
Views: 3384
Reputation: 167992
You can use JSON Path Assertion available via JMeter Plugins project like:
departureCity
equals "Bengaluru, , IN - Kempegowda International Airport
Configure it as follows:
If everything is fine the result will be successful
If expected value won't match the actual the sampler will be marked as failed:
JSON Path Assertion can be installed using JMeter Plugins Manager
Upvotes: 0
Reputation: 129
Just add response assertion in your HTTP request and add all JSON responce in Pattern to test field
Upvotes: 1