driesie
2007-11-08 09:41:43 UTC
Hi,
I'm new to JMeter, and I have been struggling with something for the last
day or so.
I am writing a test plan that envolves requesting various web services
(Webservice SOAP request).
I have everything working where I can "predict" the Soap message to post,
but now I am working on a next test for which the message will be
constructed depending on the response of a previous request.
So what I did is the following:
- Created the first Webservice sampled
- Use a XPath Extractor post processor, using "TRANSACTIONIDS" as Reference
name. The xPath query returns a collection
- Foreach Controller with input variable prefix "TRANSACTIONIDS", output
name "RETURNID"
- User Defined Variables config element with the following:
XML -> ${XML}<id>${RETURNID}</id>
- Then I use the XML variable in the soap message for a second sampler.
This doesn't work however. I am pretty sure everything works up to the
foreach controller as I can print ${TRANSACTIONIDS} and
${TRANSACTIONIDS_matchNr} fine, so I know it is returning elements. Also, if
I print ${RETURNID} it returns the last element in the collection.
So the problem is that the bit where I try to combine all elements into a
new variable isn't working. In fact, it looks like whatever variable defined
in that user defined variables config element isn't working.
What am I doing wrong, and would there be a better way of concatinating
those elements into an XML string that I can use in the SOAP message?
Thanks,
Dries.
I'm new to JMeter, and I have been struggling with something for the last
day or so.
I am writing a test plan that envolves requesting various web services
(Webservice SOAP request).
I have everything working where I can "predict" the Soap message to post,
but now I am working on a next test for which the message will be
constructed depending on the response of a previous request.
So what I did is the following:
- Created the first Webservice sampled
- Use a XPath Extractor post processor, using "TRANSACTIONIDS" as Reference
name. The xPath query returns a collection
- Foreach Controller with input variable prefix "TRANSACTIONIDS", output
name "RETURNID"
- User Defined Variables config element with the following:
XML -> ${XML}<id>${RETURNID}</id>
- Then I use the XML variable in the soap message for a second sampler.
This doesn't work however. I am pretty sure everything works up to the
foreach controller as I can print ${TRANSACTIONIDS} and
${TRANSACTIONIDS_matchNr} fine, so I know it is returning elements. Also, if
I print ${RETURNID} it returns the last element in the collection.
So the problem is that the bit where I try to combine all elements into a
new variable isn't working. In fact, it looks like whatever variable defined
in that user defined variables config element isn't working.
What am I doing wrong, and would there be a better way of concatinating
those elements into an XML string that I can use in the SOAP message?
Thanks,
Dries.
--
View this message in context: http://www.nabble.com/Variables-in-ForEach-Controller-tf4769958.html#a13643994
Sent from the JMeter - User mailing list archive at Nabble.com.
View this message in context: http://www.nabble.com/Variables-in-ForEach-Controller-tf4769958.html#a13643994
Sent from the JMeter - User mailing list archive at Nabble.com.