jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Concatenate variable list returned in HTTP GET
Date Sat, 04 Feb 2012 12:25:34 GMT
On 4 February 2012 03:23, Deepak Shetty <shettyd@gmail.com> wrote:
> write a beanshell Post Processr to loop through the regex result and form
> the String in java.
>  use the vars object to set this into a variable and use the variable in
> the next sampler

Or just transform the entire input string into the output string by
removing the bits you don't want and replacing them with the required
output elements.
That should be easy with a simple sequence of string replacements.
If you don't need access to the individual products, that might be simpler.

> On Fri, Feb 3, 2012 at 7:04 PM, testerinCO <cmolatch@comcast.net> wrote:
>
>> Hello
>>
>> Here is the output of the GET HTTP /getproductIdList
>>
>>
>> {"productIdList":[{"productId":2023345,"product":"4e83addb990ffaeba7d280f9"},{"productId":2023347,"product":"4e83edce990ffaeba7d28109"},{"productId":2023753,"product":"4e93ad2e990f87800aa8df67"},{"productId":2023871,"product":"4e9dc439990f2f3b9f3ce1de"},{"productId":2024770,"product":"4f05fda2990fd3c72b859107"},{"productId":2023365,"product":"4e84c4a6990ffaeba7d28186"},{"productId":2025071,"product":"4f22b354990fe4ae474d12fa"},{"productId":2023366,"product":"4e84d0e3990ffaeba7d2818d"},{"productId":2024644,"product":"4eebcb95990fcbfef977467e"},{"productId":2025093,"product":"4f2949e3990fd7b4fc869200"}]}
>>
>> I captured the products into an array via the regular expression extractor.
>>
>> The next HTTP request uses the products captured via the previous regular
>> expression extractor and the location identifier also captured in a
>> previous
>> regular expression extractor.
>>
>> Here is the format the request expects:
>>
>>
>> ["[com:state:XXX:location]:4e83a890990ffaeba7d280f6","[com:state:XXX:product]:4e83addb990ffaeba7d280f9","[com:state:XXX:product]:4e83edce990ffaeba7d28109","[com:state:XXX:product]:4e93ad2e990f87800aa8df67","[com:state:XXX:product]:4e9dc439990f2f3b9f3ce1de","[com:state:XXX:product]:4f05fda2990fd3c72b859107","[com:state:XXX:product]:4e84c4a6990ffaeba7d28186","[com:state:XXX:product]:4f22b354990fe4ae474d12fa","[com:state:XXX:product]:4e84d0e3990ffaeba7d2818d","[com:state:XXXr:product]:4eebcb95990fcbfef977467e","[com:state:XXX:product]:4f2949e3990fd7b4fc869200"]
>>
>> My question is, how can I build the string in jmeter.  I use the foreach
>> loop to retrieve the individual products, but I'm not sure what to use to
>> build the string
>>
>>
>> ["[com:state:XXX:location]:${Location}","[com:state:XXX:product]:${product}","[com:state:XXX:product]:${product}..........
>>
>> Thanks for all your help.
>>
>>
>>
>> --
>> View this message in context:
>> http://jmeter.512774.n5.nabble.com/Concatenate-variable-list-returned-in-HTTP-GET-tp5453990p5455665.html
>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>

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


Mime
View raw message