You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by sebb <se...@gmail.com> on 2009/09/16 02:02:04 UTC

Re: XPath-like JSON Assertion

On 14/09/2009, Richman, Michael <mi...@corp.aol.com> wrote:
> Hi,
>
>  Before I go adding my own extension to Jmeter, I figured I'd check to
>  see if it has been written already. Much Googling find little, so I
>  submit the question here.

www.json.org has a whole page of JSON links ...

>  I would like a Jmeter Assertion that does for JSON responses essentially
>  what the XPathAssertion class does for XML responses, namely, validate
>  specific data in the JSON data structure. I would probably simply use
>  XPath notation to represent the desired "path" into JSON data.
>
>  If nothing like this exists, I'll plan on writing it myself and making
>  it available to any intersted parties.

Might be easiest to convert the JSON to XML, and then use the existing
XPathAssertion code to do the rest?

Looks like XStream might be able to do this:

http://xstream.codehaus.org/json-tutorial.html

JMeter uses XStream, so already includes the library.

>  thanks,
>  michael
>
>  ______________________
>
> michael richman
>  sys architect
>  aol global svcs technology
>  303-486-4029
>  AIM: mrwoof
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


RE: XPath-like JSON Assertion

Posted by "Richman, Michael" <mi...@corp.aol.com>.
Yes, I wasn't Googling for JSON links; that's obvious. I was looking for
"Jmeter JSON Assertion" solutions.

I will take a look at XStream and other solutions.

thanks,
michael


___________________
michael richman 
sys architect
global svcs technology
303-486-4029
AIM: mrwoof

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Tuesday, September 15, 2009 6:02 PM
To: JMeter Developers List
Subject: Re: XPath-like JSON Assertion

On 14/09/2009, Richman, Michael <mi...@corp.aol.com> wrote:
> Hi,
>
>  Before I go adding my own extension to Jmeter, I figured I'd check to

> see if it has been written already. Much Googling find little, so I  
> submit the question here.

www.json.org has a whole page of JSON links ...

>  I would like a Jmeter Assertion that does for JSON responses 
> essentially  what the XPathAssertion class does for XML responses, 
> namely, validate  specific data in the JSON data structure. I would 
> probably simply use  XPath notation to represent the desired "path"
into JSON data.
>
>  If nothing like this exists, I'll plan on writing it myself and 
> making  it available to any intersted parties.

Might be easiest to convert the JSON to XML, and then use the existing
XPathAssertion code to do the rest?

Looks like XStream might be able to do this:

http://xstream.codehaus.org/json-tutorial.html

JMeter uses XStream, so already includes the library.

>  thanks,
>  michael
>
>  ______________________
>
> michael richman
>  sys architect
>  aol global svcs technology
>  303-486-4029
>  AIM: mrwoof
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org