jmeter json path espressions learning

 jsonpath expressions can be used to value point or brackets

Tube side Details: https: //goessner.net/articles/JsonPath/

$: Root Object

@: Indicates the current object

Or []: represents the child operator

(): Script expression

? (): Applying a filter (script) expression

Examples are as follows:

{ "store": {
    "book": [ 
      { "category": "reference",
        "author": "Nigel Rees",
        "title": "Sayings of the Century",
        "price": 8.95
      },
      { "category": "fiction",
        "author": "Evelyn Waugh",
        "title": "Sword of Honour",
        "price": 12.99
      },
      { "category": "fiction",
        "author": "Herman Melville",
        "title": "Moby Dick",
        "isbn": "0-553-21311-3",
        "price": 8.99
      },
      { "category": "fiction",
        "author": "J. R. R. Tolkien",
        "title": "The Lord of the Rings",
        "isbn": "0-395-19395-8",
        "price": 22.99
      }
    ],
    "bicycle": {
      "color": "red",
      "price": 19.95
    }
  }

. $ .Store.book [*] author: Author store all the books (four Author)

$ .. author: All authors

$ .Store *:. Store everything, including book and bicycle

$ .Store..price: the price of everything

$ .. book [2]: The third book

$ .. book [0,2] or $ .. book [: 2]: two books ago

 $ .. book [(@ isbn.)?]: No filter all books by isbn

$ .. book [(@ price <10.)?]: Filter all cheaper than 10 books

$ .. *: all the elements in the XML document

Guess you like

Origin www.cnblogs.com/zddwork/p/11315785.html