You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ed Young <ej...@summitbid.com> on 2009/04/24 23:56:33 UTC

__Xpath function does find next match

The _XPath function is described to behave like this:

Each time the function is called, the next match will be returned. At
end of file, it will wrap around to the start.

I'm not seeing this. It seems to read only the first match of the
XPath expression.

I've set the test to iterate 5 times for example and the function
always returns the same value.

-- 
- Ed

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


Re: __Xpath function does find next match

Posted by Ed Young <ej...@summitbid.com>.
That was the fix. Thank you sir.

On Fri, Apr 24, 2009 at 8:08 PM, sebb <se...@gmail.com> wrote:
> On 25/04/2009, Ed Young <ej...@summitbid.com> wrote:
>> I've tried putting the method defination in two places
>>  1. as a user defined variable in the Test Plan
>>  2. As a config element->User Defined Variable under the Thread Group.
>
> Those are both config elements, and are only processed once.
>
> Try User Parameters Pre-Processor instead.
>
>>  ${__XPath(c:\temp\r2state.xml, //R2State/Pumps/Pump/@qamPort)}
>>
>>  I make the call in a TCPSampler in the Thread Group
>>
>>  client_port=${QAM_PORT}
>>
>>  I'm running JMeter version 2.3.2-r665936
>>
>>
>>
>>
>>  On Fri, Apr 24, 2009 at 5:51 PM, sebb <se...@gmail.com> wrote:
>>  > On 24/04/2009, Ed Young <ej...@summitbid.com> wrote:
>>  >> The _XPath function is described to behave like this:
>>  >>
>>  >>  Each time the function is called, the next match will be returned. At
>>  >>  end of file, it will wrap around to the start.
>>  >>
>>  >>  I'm not seeing this. It seems to read only the first match of the
>>  >>  XPath expression.
>>  >>
>>  >>  I've set the test to iterate 5 times for example and the function
>>  >>  always returns the same value.
>>  >
>>  > Works OK for me. Where have you put the call to the function?
>>  >
>>  >>
>>  >>  --
>>  >>  - Ed
>>  >>
>>  >>  ---------------------------------------------------------------------
>>  >>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>  >>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>  >>
>>  >>
>>  >
>>  > ---------------------------------------------------------------------
>>  > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>  > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>  >
>>  >
>>
>>
>>
>>
>> --
>>
>> - Ed
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>



-- 
- Ed

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


Re: __Xpath function does find next match

Posted by sebb <se...@gmail.com>.
On 25/04/2009, Ed Young <ej...@summitbid.com> wrote:
> I've tried putting the method defination in two places
>  1. as a user defined variable in the Test Plan
>  2. As a config element->User Defined Variable under the Thread Group.

Those are both config elements, and are only processed once.

Try User Parameters Pre-Processor instead.

>  ${__XPath(c:\temp\r2state.xml, //R2State/Pumps/Pump/@qamPort)}
>
>  I make the call in a TCPSampler in the Thread Group
>
>  client_port=${QAM_PORT}
>
>  I'm running JMeter version 2.3.2-r665936
>
>
>
>
>  On Fri, Apr 24, 2009 at 5:51 PM, sebb <se...@gmail.com> wrote:
>  > On 24/04/2009, Ed Young <ej...@summitbid.com> wrote:
>  >> The _XPath function is described to behave like this:
>  >>
>  >>  Each time the function is called, the next match will be returned. At
>  >>  end of file, it will wrap around to the start.
>  >>
>  >>  I'm not seeing this. It seems to read only the first match of the
>  >>  XPath expression.
>  >>
>  >>  I've set the test to iterate 5 times for example and the function
>  >>  always returns the same value.
>  >
>  > Works OK for me. Where have you put the call to the function?
>  >
>  >>
>  >>  --
>  >>  - Ed
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >>
>  >>
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >
>  >
>
>
>
>
> --
>
> - Ed
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


Re: __Xpath function does find next match

Posted by Ed Young <ej...@summitbid.com>.
I've tried putting the method defination in two places
1. as a user defined variable in the Test Plan
2. As a config element->User Defined Variable under the Thread Group.

${__XPath(c:\temp\r2state.xml, //R2State/Pumps/Pump/@qamPort)}

I make the call in a TCPSampler in the Thread Group

client_port=${QAM_PORT}

I'm running JMeter version 2.3.2-r665936



On Fri, Apr 24, 2009 at 5:51 PM, sebb <se...@gmail.com> wrote:
> On 24/04/2009, Ed Young <ej...@summitbid.com> wrote:
>> The _XPath function is described to behave like this:
>>
>>  Each time the function is called, the next match will be returned. At
>>  end of file, it will wrap around to the start.
>>
>>  I'm not seeing this. It seems to read only the first match of the
>>  XPath expression.
>>
>>  I've set the test to iterate 5 times for example and the function
>>  always returns the same value.
>
> Works OK for me. Where have you put the call to the function?
>
>>
>>  --
>>  - Ed
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>



-- 
- Ed

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


Re: __Xpath function does find next match

Posted by sebb <se...@gmail.com>.
On 24/04/2009, Ed Young <ej...@summitbid.com> wrote:
> The _XPath function is described to behave like this:
>
>  Each time the function is called, the next match will be returned. At
>  end of file, it will wrap around to the start.
>
>  I'm not seeing this. It seems to read only the first match of the
>  XPath expression.
>
>  I've set the test to iterate 5 times for example and the function
>  always returns the same value.

Works OK for me. Where have you put the call to the function?

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

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