You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ori Marco <or...@praxell.com> on 2007/12/19 15:56:26 UTC

Jmeter support of template engines

Hi

 

I need to execute requests with strings that are dynamic templates.

For example sending HTTP request with optional parameters A=${A}<#if B
exists?>&B=${B}</#if>

It seems that I need to use template engine as free maker/velocity to
update parameters/samplers.

 

Is there such option/support in Jmeter?

 

Thanks

 

Ori Marko

Quality Assurance Engineer

Praxell Inc.

http://www.praxell.com


RE: Jmeter support of template engines

Posted by Ori Marco <or...@praxell.com>.
Hi

I still need to use template engine, I added jar with implementation:
VelocityContext.transformText(TemplateContext tc, bsh.args[0], output);
It need only TemplateContext and string to evaluate.
In Beanshell sampler I have vars and ctx, How can I cast it to
TemplateContext?

Thanks

Ori Marko 
Quality Assurance Engineer 
Praxell Inc.
http://www.praxell.com

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Thursday, December 20, 2007 2:03 AM
To: JMeter Users List
Subject: Re: Jmeter support of template engines

HTTP Parameters are ignored if the name is missing (or blank)

So you can create parameters with variable names and contents, and
just set the name to empty to skip it.

On 19/12/2007, Ori Marco <or...@praxell.com> wrote:
> Hi
>
>
>
> I need to execute requests with strings that are dynamic templates.
>
> For example sending HTTP request with optional parameters A=${A}<#if B
> exists?>&B=${B}</#if>
>
> It seems that I need to use template engine as free maker/velocity to
> update parameters/samplers.
>
>
>
> Is there such option/support in Jmeter?
>
>
>
> Thanks
>
>
>
> Ori Marko
>
> Quality Assurance Engineer
>
> Praxell Inc.
>
> http://www.praxell.com
>
>

---------------------------------------------------------------------
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: Jmeter support of template engines

Posted by Er...@Schange.com.
Not sure I follow what you're trying to do, but runTest is supposed to 
perform a single "sample" and then return the response (SampleResult). The 
context doesn't have the response, runTest has to create it.




"Ori Marco" <or...@praxell.com> 
12/20/2007 10:28 AM
Please respond to
"JMeter Users List" <jm...@jakarta.apache.org>


To
"JMeter Users List" <jm...@jakarta.apache.org>
cc

Subject
RE: Jmeter support of template engines






Hi

I tried to implement new class which extends AbstractJavaSamplerClient
to use velocity evaluate function
Inside runTest function.
But it seems that the response can't be changed (because it's a part of
JavaSamplerContext)

What should be done to set response the evaluated string?

Thanks

Ori Marko 
Quality Assurance Engineer 
Praxell Inc.
http://www.praxell.com

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Thursday, December 20, 2007 2:03 AM
To: JMeter Users List
Subject: Re: Jmeter support of template engines

HTTP Parameters are ignored if the name is missing (or blank)

So you can create parameters with variable names and contents, and
just set the name to empty to skip it.

On 19/12/2007, Ori Marco <or...@praxell.com> wrote:
> Hi
>
>
>
> I need to execute requests with strings that are dynamic templates.
>
> For example sending HTTP request with optional parameters A=${A}<#if B
> exists?>&B=${B}</#if>
>
> It seems that I need to use template engine as free maker/velocity to
> update parameters/samplers.
>
>
>
> Is there such option/support in Jmeter?
>
>
>
> Thanks
>
>
>
> Ori Marko
>
> Quality Assurance Engineer
>
> Praxell Inc.
>
> http://www.praxell.com
>
>

---------------------------------------------------------------------
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: Jmeter support of template engines

Posted by Ori Marco <or...@praxell.com>.
Hi

I tried to implement new class which extends AbstractJavaSamplerClient
to use velocity evaluate function
Inside runTest function.
But it seems that the response can't be changed (because it's a part of
JavaSamplerContext)

What should be done to set response the evaluated string?

Thanks

Ori Marko 
Quality Assurance Engineer 
Praxell Inc.
http://www.praxell.com

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Thursday, December 20, 2007 2:03 AM
To: JMeter Users List
Subject: Re: Jmeter support of template engines

HTTP Parameters are ignored if the name is missing (or blank)

So you can create parameters with variable names and contents, and
just set the name to empty to skip it.

On 19/12/2007, Ori Marco <or...@praxell.com> wrote:
> Hi
>
>
>
> I need to execute requests with strings that are dynamic templates.
>
> For example sending HTTP request with optional parameters A=${A}<#if B
> exists?>&B=${B}</#if>
>
> It seems that I need to use template engine as free maker/velocity to
> update parameters/samplers.
>
>
>
> Is there such option/support in Jmeter?
>
>
>
> Thanks
>
>
>
> Ori Marko
>
> Quality Assurance Engineer
>
> Praxell Inc.
>
> http://www.praxell.com
>
>

---------------------------------------------------------------------
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: Jmeter support of template engines

Posted by sebb <se...@gmail.com>.
HTTP Parameters are ignored if the name is missing (or blank)

So you can create parameters with variable names and contents, and
just set the name to empty to skip it.

On 19/12/2007, Ori Marco <or...@praxell.com> wrote:
> Hi
>
>
>
> I need to execute requests with strings that are dynamic templates.
>
> For example sending HTTP request with optional parameters A=${A}<#if B
> exists?>&B=${B}</#if>
>
> It seems that I need to use template engine as free maker/velocity to
> update parameters/samplers.
>
>
>
> Is there such option/support in Jmeter?
>
>
>
> Thanks
>
>
>
> Ori Marko
>
> Quality Assurance Engineer
>
> Praxell Inc.
>
> http://www.praxell.com
>
>

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