You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Pruitt, Steve" <SP...@exstream.com> on 2007/05/17 22:40:09 UTC

Javascript function

This is a newbie question, as I am just coming up to speed on Jmeter.

In my HTTPRequest I including an attachment.  In the Value for "name"
attribute, I would like a to have a name that contains an incremented
number.  I couldn't find any good samples, so I took a stab at it.  I
created Counter to supply the number and assigned it a ReferenceName.
In the HTTPRequest, I have ${_javascript("file" + ${nextFileX})} as the
value for the name attribute, where nextFileX is the Counter'
ReferenceName.  It doesn't work, which is probably obvious to many of
you.  Any help is greatly appreciated.


-S

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


Re: Base64 decoding in the viewer.

Posted by sebb <se...@gmail.com>.
You could write a BeanShell Post-Processor that changed the sampler
data, or you could write a BeanShell Listener to display the data
directly.

Or you could create your own Listener, e.g. by extending/amending the
Tree View Listener.

However, these would all require Java coding experience.

If the conversion could be done by using an XSL stylesheet, then it
might be worth considering creating a Listener that could apply the
stylesheet to the data for display.

You could test this by using Save Responses to a File and adding the
stylesheet reference to it.

S.
On 18/05/07, lists@dankeeley.co.uk <li...@dankeeley.co.uk> wrote:
> Hi,
>
> We use jmeter to view responses in our XML/RPC application.
>
> Sometimes parts of the xml response message are base64 encoded due to
> using characters otherwise invalid in the XML/RPC Spec.
>
> So my question is could we devise a way to tell the jmeter response viewer
> pane which bit is encoded, and therefore how to decode it?
>
> This seems unlikely, but worth asking!  For now we just have to carefully
> cut and paste into an online base64 decoder.
>
> Thanks,
> Dan
>
> ---------------------------------------------------------------------
> 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


Base64 decoding in the viewer.

Posted by li...@dankeeley.co.uk.
Hi,

We use jmeter to view responses in our XML/RPC application.

Sometimes parts of the xml response message are base64 encoded due to
using characters otherwise invalid in the XML/RPC Spec.

So my question is could we devise a way to tell the jmeter response viewer
pane which bit is encoded, and therefore how to decode it?

This seems unlikely, but worth asking!  For now we just have to carefully
cut and paste into an online base64 decoder.

Thanks,
Dan

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


RE: Javascript function

Posted by "Pruitt, Steve" <SP...@exstream.com>.
Thank you.  Sometimes the best way is not so obvious.  I will do a
better job reading the doc.


-S 

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Friday, May 18, 2007 8:13 AM
To: JMeter Users List
Subject: Re: Javascript function

Why not just use the following name?

file${nextFileX}

The variable reference will be replaced by the value of nextFileX - e.g.
if it is 456 then the name will be

file456

Or you could use:

file${nextFileX}.xyz

to generate

file456.xyz


S.
On 17/05/07, Pruitt, Steve <SP...@exstream.com> wrote:
> This is a newbie question, as I am just coming up to speed on Jmeter.
>
> In my HTTPRequest I including an attachment.  In the Value for "name"
> attribute, I would like a to have a name that contains an incremented 
> number.  I couldn't find any good samples, so I took a stab at it.  I 
> created Counter to supply the number and assigned it a ReferenceName.
> In the HTTPRequest, I have ${_javascript("file" + ${nextFileX})} as 
> the value for the name attribute, where nextFileX is the Counter'
> ReferenceName.  It doesn't work, which is probably obvious to many of 
> you.  Any help is greatly appreciated.
>
>
> -S
>
> ---------------------------------------------------------------------
> 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


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


Re: Javascript function

Posted by sebb <se...@gmail.com>.
Why not just use the following name?

file${nextFileX}

The variable reference will be replaced by the value of nextFileX -
e.g. if it is 456 then the name will be

file456

Or you could use:

file${nextFileX}.xyz

to generate

file456.xyz


S.
On 17/05/07, Pruitt, Steve <SP...@exstream.com> wrote:
> This is a newbie question, as I am just coming up to speed on Jmeter.
>
> In my HTTPRequest I including an attachment.  In the Value for "name"
> attribute, I would like a to have a name that contains an incremented
> number.  I couldn't find any good samples, so I took a stab at it.  I
> created Counter to supply the number and assigned it a ReferenceName.
> In the HTTPRequest, I have ${_javascript("file" + ${nextFileX})} as the
> value for the name attribute, where nextFileX is the Counter'
> ReferenceName.  It doesn't work, which is probably obvious to many of
> you.  Any help is greatly appreciated.
>
>
> -S
>
> ---------------------------------------------------------------------
> 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