On 5/2/05, Dave Maung <[EMAIL PROTECTED]> wrote: > Seb, > The scenario is very simple. > I have one request relie on last previous reponse. > > and previous reponse return following xml > > <response> > <params> > <param name="dave" id="1"/> > <param name="dave2" id="2"/> > </parms> > > </response> > > > I have to extract name and id attribute in parallel to generate many > requests in a loop. > http://localhost/search?name=dave&id=1 > http://localhost/search?name=dave2&id=2 > I cannot use the current foreach controller because I can only reference one > variable.
But you *can* combine groups in the Regex output variable. Try setting: RE: <param name="(.+?)" id="(.+?)"/> Template: name=$1$&id=$2$ You then need to tell the HTTP Sampler not to encode the parameters nor add the equals, as you have already done it. If that does not work, try: Template: $1$&id=$2$ and add "name" as a parameter, value from the resultvar, no encoding. > > > In xslt, it can be easily done > <xsl:foreach select="/response/parmas"> > http://localhost/search?name=<xsl:value-of > select="@name"/>&id=<xsl:value-of select="@id"/> > </xsl:foreach> > > > I have given up extracting response using regular expression for my xml > response because it doesnt work out pretty well with xml docuemnt. Surely that depends on the document? > I am thinking to implement XPath Foreach Controller to generate Jmeter xpath > variable using Xalan. It may take 3-4 weeks. So one question I have is when > is the next release and code freeze for JMeter? Don't know. But I'd be surprised if any code changes impacted much if at all on a new Controller. > I still have a few code > changes to support tool tips text feature for Render xml. I will send you a > code on Thurs or Fri. Thanks - please add these to the Bugzilla issue. > > Dave > > > sebb <[EMAIL PROTECTED]> wrote: > The ForEach Controller looks at the variables inputVar_n (n=1,2,3...) > and for each one it finds, sets returnVar to the contents. It stops > when one of the variables is not defined. > > It does not set up returnVar1 or returnVar_g1 etc - only returnVar. > > I'm not clear what you are trying to do with the extracted values. > Perhaps you could describe a concrete example. > > S. > On 4/29/05, Dave Maung wrote: > > > > Thanks, sebb. > > > > Random index seem to work. How about If I want to extract all the group > > value that I got from reg extractor within one loop. > > > > I tried using foreachController > > and then ${returnVar_g1} ${returnVar_g2} doesnt seem to work. Is it > because > > it is not currently supported? Or maybe I am doing it wrong? please look > at > > my testcase. > > > > > > Dave > > > > sebb wrote: > > Try the Regex Extractor with: > > > > RE: > > Template: $1$$2$ > > Index: -1 > > > > This will extract both parts as a single variable. > > > > You can also use refName_n_gm where > > n=1,2,3 (match number) > > m=0,1,2 = group number. 0 = whole text matched by RE > > > > Seems to me this does what you want. > > > > e.g refName_2_g2=item3 in this case. > > > > S. > > On 4/27/05, Dave Maung wrote: > > > I am trying to extract the following xml using regular expression > > > > > > > > > > > > > > > > > > > > > I would like to extract "index" and "name" value within the same loop. I > > am not sure for each controller will be able to do it. It seem like you > can > > only access one value index in one loop. > > > > > > ex in java code: > > > for(int i=0; i< size(); i++) { > > > do ${index[0]} , ${name[0]} > > > } > > > > > > I am also wondering is JMeter variable support array l${index[0]} > > variable. this would be make it very easy to loop and accessing index > value > > randomly. > > > > > > Just a suggestion to extend the functionality of JMeter variable. > > > > > > Dave > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

