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/18 11:28:02 UTC

Jmeter+javascript issue

Hi

 

I want to assert http request with variable, but to do so I need to
convert some chars in regular expression value:

 ^,?,+ should be added \ before and space char should be convert to %20

e.g. Http request is: Param1=^ABC&Param2=A%20B%20C

Regular expression value before conversion: Param1=^ABC&Param2=A B C

 

What is the best way to convert?

I tried to use JavaScript in User parameters component but failed (
didn't replace any chars):

Value    ${__javaScript(${Value }.replace(/^/g, "\^"))}

Value    ${__javaScript(${Value }.replace(/ /g,"%20"))}

 

What can be done to achieve this conversions?

 

Thanks 

Ori Marko 
Quality Assurance Engineer 
Praxell Inc.
Mobile: 0524-455-177
Office:03-6126060 Ext 612
Fax: 03-6126066
http://www.praxell.com <http://www.praxell.com> 


RE: Jmeter+javascript issue

Posted by Ori Marco <or...@praxell.com>.
Found it....
${__javaScript('${Value1}'.replace(/\*/g\,"\\\*"))}

Ori Marko 
Quality Assurance Engineer 
Praxell Inc.
Mobile: 0524-455-177
Office:03-6126060 Ext 612
Fax: 03-6126066
http://www.praxell.com

-----Original Message-----
From: Ori Marco [mailto:orim@praxell.com] 
Sent: Wednesday, December 19, 2007 10:12 AM
To: JMeter Users List
Subject: RE: Jmeter+javascript issue

Hi

I succeeded with ${__javaScript('${Value1}'.replace(/ /g\, "%20"))}

But I can't replace * with /* (or same with ^) I tried the following
with no luck:
${__javaScript('${Value1}'.replace(/\*/g, "\*"))}
${__javaScript('${Value1}'.replace(/\*/g, "\\*"))}
${__javaScript('${Value1}'.replace(/*/g, "\*"))}

Do you know what's wrong? ( In JavaScript (/\*/g, "\\*") works)

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

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Tuesday, December 18, 2007 5:52 PM
To: JMeter Users List
Subject: Re: Jmeter+javascript issue

You need to quote the value to turn it into a string. See note under:

http://jakarta.apache.org/jmeter/usermanual/functions.html#where

On 18/12/2007, Ori Marco <or...@praxell.com> wrote:
> Hi
>
> I escaped the comma: Value    ${__javaScript(${Value }.replace(/^/g\,
> "\^"))}
> and still got an error:
>
> 2007/12/18 17:44:14 ERROR - jmeter.threads.JMeterThread:
> org.mozilla.javascript.EvaluatorException: Invalid assignment
left-hand
> side. (<cmd>#1)
>        at
>
org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorRep
> orter.java:98)
>        at
>
org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.j
> ava:85)
>        at org.mozilla.javascript.Parser.addError(Parser.java:126)
>        at org.mozilla.javascript.Parser.reportError(Parser.java:132)
>        at
> org.mozilla.javascript.IRFactory.createAssignment(IRFactory.java:1254)
>        at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
>        at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
>        at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
>        at org.mozilla.javascript.Parser.expr(Parser.java:1224)
>        at
> org.mozilla.javascript.Parser.statementHelper(Parser.java:1111)
>        at org.mozilla.javascript.Parser.statement(Parser.java:623)
>        at org.mozilla.javascript.Parser.parse(Parser.java:355)
>        at org.mozilla.javascript.Parser.parse(Parser.java:293)
>        at
org.mozilla.javascript.Context.compileImpl(Context.java:2238)
>        at
> org.mozilla.javascript.Context.compileString(Context.java:1284)
>        at
> org.mozilla.javascript.Context.compileString(Context.java:1273)
>        at
> org.mozilla.javascript.Context.evaluateString(Context.java:1129)
>        at
> org.apache.jmeter.functions.JavaScript.execute(JavaScript.java:80)
>        at
>
org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.
> java:128)
>        at
>
org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.
> java:97)
>        at
>
org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(F
> unctionProperty.java:85)
>        at
>
org.apache.jmeter.modifiers.UserParameters.setValues(UserParameters.java
> :137)
>        at
>
org.apache.jmeter.modifiers.UserParameters.process(UserParameters.java:1
> 23)
>        at
>
org.apache.jmeter.threads.TestCompiler.runPreProcessors(TestCompiler.jav
> a:106)
>        at
>
org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.jav
> a:87)
>        at
> org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:285)
>        at java.lang.Thread.run(Unknown Source)
>
> Ori Marko
> Quality Assurance Engineer
> Praxell Inc.
> Mobile: 0524-455-177
> Office:03-6126060 Ext 612
> Fax: 03-6126066
> http://www.praxell.com
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Tuesday, December 18, 2007 5:36 PM
> To: JMeter Users List
> Subject: Re: Jmeter+javascript issue
>
> Check jmeter.log for errors.
>
> I expect you will find a syntax error because of the unescaped comma
>
> On 18/12/2007, Ori Marco <or...@praxell.com> wrote:
> > Hi
> >
> > Just adding that It works in JavaScript on html and I tried and
failed
> > also to add '' to variable name as follow
> >
> > Value    ${__javaScript('${Value }'.replace(/^/g, "\^"))}
> >
> > Value    ${__javaScript('${Value }'.replace(/ /g,"%20"))}
> >
> > FYI
> >
> > Ori Marko
> > Quality Assurance Engineer
> > Praxell Inc.
> > http://www.praxell.com
> >
> > -----Original Message-----
> > From: Ori Marco [mailto:orim@praxell.com]
> > Sent: Tuesday, December 18, 2007 12:28 PM
> > To: JMeter Users List
> > Subject: Jmeter+javascript issue
> >
> > Hi
> >
> >
> >
> > I want to assert http request with variable, but to do so I need to
> > convert some chars in regular expression value:
> >
> >  ^,?,+ should be added \ before and space char should be convert to
> %20
> >
> > e.g. Http request is: Param1=^ABC&Param2=A%20B%20C
> >
> > Regular expression value before conversion: Param1=^ABC&Param2=A B C
> >
> >
> >
> > What is the best way to convert?
> >
> > I tried to use JavaScript in User parameters component but failed (
> > didn't replace any chars):
> >
> > Value    ${__javaScript(${Value }.replace(/^/g, "\^"))}
> >
> > Value    ${__javaScript(${Value }.replace(/ /g,"%20"))}
> >
> >
> >
> > What can be done to achieve this conversions?
> >
> >
> >
> > Thanks
> >
> > Ori Marko
> > Quality Assurance Engineer
> > Praxell Inc.
> > Mobile: 0524-455-177
> > Office:03-6126060 Ext 612
> > Fax: 03-6126066
> > http://www.praxell.com <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
>
>
> ---------------------------------------------------------------------
> 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


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


RE: Jmeter+javascript issue

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

I succeeded with ${__javaScript('${Value1}'.replace(/ /g\, "%20"))}

But I can't replace * with /* (or same with ^) I tried the following
with no luck:
${__javaScript('${Value1}'.replace(/\*/g, "\*"))}
${__javaScript('${Value1}'.replace(/\*/g, "\\*"))}
${__javaScript('${Value1}'.replace(/*/g, "\*"))}

Do you know what's wrong? ( In JavaScript (/\*/g, "\\*") works)

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

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Tuesday, December 18, 2007 5:52 PM
To: JMeter Users List
Subject: Re: Jmeter+javascript issue

You need to quote the value to turn it into a string. See note under:

http://jakarta.apache.org/jmeter/usermanual/functions.html#where

On 18/12/2007, Ori Marco <or...@praxell.com> wrote:
> Hi
>
> I escaped the comma: Value    ${__javaScript(${Value }.replace(/^/g\,
> "\^"))}
> and still got an error:
>
> 2007/12/18 17:44:14 ERROR - jmeter.threads.JMeterThread:
> org.mozilla.javascript.EvaluatorException: Invalid assignment
left-hand
> side. (<cmd>#1)
>        at
>
org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorRep
> orter.java:98)
>        at
>
org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.j
> ava:85)
>        at org.mozilla.javascript.Parser.addError(Parser.java:126)
>        at org.mozilla.javascript.Parser.reportError(Parser.java:132)
>        at
> org.mozilla.javascript.IRFactory.createAssignment(IRFactory.java:1254)
>        at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
>        at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
>        at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
>        at org.mozilla.javascript.Parser.expr(Parser.java:1224)
>        at
> org.mozilla.javascript.Parser.statementHelper(Parser.java:1111)
>        at org.mozilla.javascript.Parser.statement(Parser.java:623)
>        at org.mozilla.javascript.Parser.parse(Parser.java:355)
>        at org.mozilla.javascript.Parser.parse(Parser.java:293)
>        at
org.mozilla.javascript.Context.compileImpl(Context.java:2238)
>        at
> org.mozilla.javascript.Context.compileString(Context.java:1284)
>        at
> org.mozilla.javascript.Context.compileString(Context.java:1273)
>        at
> org.mozilla.javascript.Context.evaluateString(Context.java:1129)
>        at
> org.apache.jmeter.functions.JavaScript.execute(JavaScript.java:80)
>        at
>
org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.
> java:128)
>        at
>
org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.
> java:97)
>        at
>
org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(F
> unctionProperty.java:85)
>        at
>
org.apache.jmeter.modifiers.UserParameters.setValues(UserParameters.java
> :137)
>        at
>
org.apache.jmeter.modifiers.UserParameters.process(UserParameters.java:1
> 23)
>        at
>
org.apache.jmeter.threads.TestCompiler.runPreProcessors(TestCompiler.jav
> a:106)
>        at
>
org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.jav
> a:87)
>        at
> org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:285)
>        at java.lang.Thread.run(Unknown Source)
>
> Ori Marko
> Quality Assurance Engineer
> Praxell Inc.
> Mobile: 0524-455-177
> Office:03-6126060 Ext 612
> Fax: 03-6126066
> http://www.praxell.com
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Tuesday, December 18, 2007 5:36 PM
> To: JMeter Users List
> Subject: Re: Jmeter+javascript issue
>
> Check jmeter.log for errors.
>
> I expect you will find a syntax error because of the unescaped comma
>
> On 18/12/2007, Ori Marco <or...@praxell.com> wrote:
> > Hi
> >
> > Just adding that It works in JavaScript on html and I tried and
failed
> > also to add '' to variable name as follow
> >
> > Value    ${__javaScript('${Value }'.replace(/^/g, "\^"))}
> >
> > Value    ${__javaScript('${Value }'.replace(/ /g,"%20"))}
> >
> > FYI
> >
> > Ori Marko
> > Quality Assurance Engineer
> > Praxell Inc.
> > http://www.praxell.com
> >
> > -----Original Message-----
> > From: Ori Marco [mailto:orim@praxell.com]
> > Sent: Tuesday, December 18, 2007 12:28 PM
> > To: JMeter Users List
> > Subject: Jmeter+javascript issue
> >
> > Hi
> >
> >
> >
> > I want to assert http request with variable, but to do so I need to
> > convert some chars in regular expression value:
> >
> >  ^,?,+ should be added \ before and space char should be convert to
> %20
> >
> > e.g. Http request is: Param1=^ABC&Param2=A%20B%20C
> >
> > Regular expression value before conversion: Param1=^ABC&Param2=A B C
> >
> >
> >
> > What is the best way to convert?
> >
> > I tried to use JavaScript in User parameters component but failed (
> > didn't replace any chars):
> >
> > Value    ${__javaScript(${Value }.replace(/^/g, "\^"))}
> >
> > Value    ${__javaScript(${Value }.replace(/ /g,"%20"))}
> >
> >
> >
> > What can be done to achieve this conversions?
> >
> >
> >
> > Thanks
> >
> > Ori Marko
> > Quality Assurance Engineer
> > Praxell Inc.
> > Mobile: 0524-455-177
> > Office:03-6126060 Ext 612
> > Fax: 03-6126066
> > http://www.praxell.com <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
>
>
> ---------------------------------------------------------------------
> 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: Jmeter+javascript issue

Posted by sebb <se...@gmail.com>.
You need to quote the value to turn it into a string. See note under:

http://jakarta.apache.org/jmeter/usermanual/functions.html#where

On 18/12/2007, Ori Marco <or...@praxell.com> wrote:
> Hi
>
> I escaped the comma: Value    ${__javaScript(${Value }.replace(/^/g\,
> "\^"))}
> and still got an error:
>
> 2007/12/18 17:44:14 ERROR - jmeter.threads.JMeterThread:
> org.mozilla.javascript.EvaluatorException: Invalid assignment left-hand
> side. (<cmd>#1)
>        at
> org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorRep
> orter.java:98)
>        at
> org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.j
> ava:85)
>        at org.mozilla.javascript.Parser.addError(Parser.java:126)
>        at org.mozilla.javascript.Parser.reportError(Parser.java:132)
>        at
> org.mozilla.javascript.IRFactory.createAssignment(IRFactory.java:1254)
>        at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
>        at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
>        at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
>        at org.mozilla.javascript.Parser.expr(Parser.java:1224)
>        at
> org.mozilla.javascript.Parser.statementHelper(Parser.java:1111)
>        at org.mozilla.javascript.Parser.statement(Parser.java:623)
>        at org.mozilla.javascript.Parser.parse(Parser.java:355)
>        at org.mozilla.javascript.Parser.parse(Parser.java:293)
>        at org.mozilla.javascript.Context.compileImpl(Context.java:2238)
>        at
> org.mozilla.javascript.Context.compileString(Context.java:1284)
>        at
> org.mozilla.javascript.Context.compileString(Context.java:1273)
>        at
> org.mozilla.javascript.Context.evaluateString(Context.java:1129)
>        at
> org.apache.jmeter.functions.JavaScript.execute(JavaScript.java:80)
>        at
> org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.
> java:128)
>        at
> org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.
> java:97)
>        at
> org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(F
> unctionProperty.java:85)
>        at
> org.apache.jmeter.modifiers.UserParameters.setValues(UserParameters.java
> :137)
>        at
> org.apache.jmeter.modifiers.UserParameters.process(UserParameters.java:1
> 23)
>        at
> org.apache.jmeter.threads.TestCompiler.runPreProcessors(TestCompiler.jav
> a:106)
>        at
> org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.jav
> a:87)
>        at
> org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:285)
>        at java.lang.Thread.run(Unknown Source)
>
> Ori Marko
> Quality Assurance Engineer
> Praxell Inc.
> Mobile: 0524-455-177
> Office:03-6126060 Ext 612
> Fax: 03-6126066
> http://www.praxell.com
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Tuesday, December 18, 2007 5:36 PM
> To: JMeter Users List
> Subject: Re: Jmeter+javascript issue
>
> Check jmeter.log for errors.
>
> I expect you will find a syntax error because of the unescaped comma
>
> On 18/12/2007, Ori Marco <or...@praxell.com> wrote:
> > Hi
> >
> > Just adding that It works in JavaScript on html and I tried and failed
> > also to add '' to variable name as follow
> >
> > Value    ${__javaScript('${Value }'.replace(/^/g, "\^"))}
> >
> > Value    ${__javaScript('${Value }'.replace(/ /g,"%20"))}
> >
> > FYI
> >
> > Ori Marko
> > Quality Assurance Engineer
> > Praxell Inc.
> > http://www.praxell.com
> >
> > -----Original Message-----
> > From: Ori Marco [mailto:orim@praxell.com]
> > Sent: Tuesday, December 18, 2007 12:28 PM
> > To: JMeter Users List
> > Subject: Jmeter+javascript issue
> >
> > Hi
> >
> >
> >
> > I want to assert http request with variable, but to do so I need to
> > convert some chars in regular expression value:
> >
> >  ^,?,+ should be added \ before and space char should be convert to
> %20
> >
> > e.g. Http request is: Param1=^ABC&Param2=A%20B%20C
> >
> > Regular expression value before conversion: Param1=^ABC&Param2=A B C
> >
> >
> >
> > What is the best way to convert?
> >
> > I tried to use JavaScript in User parameters component but failed (
> > didn't replace any chars):
> >
> > Value    ${__javaScript(${Value }.replace(/^/g, "\^"))}
> >
> > Value    ${__javaScript(${Value }.replace(/ /g,"%20"))}
> >
> >
> >
> > What can be done to achieve this conversions?
> >
> >
> >
> > Thanks
> >
> > Ori Marko
> > Quality Assurance Engineer
> > Praxell Inc.
> > Mobile: 0524-455-177
> > Office:03-6126060 Ext 612
> > Fax: 03-6126066
> > http://www.praxell.com <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
>
>
> ---------------------------------------------------------------------
> 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+javascript issue

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

I escaped the comma: Value    ${__javaScript(${Value }.replace(/^/g\,
"\^"))}
and still got an error:

2007/12/18 17:44:14 ERROR - jmeter.threads.JMeterThread:
org.mozilla.javascript.EvaluatorException: Invalid assignment left-hand
side. (<cmd>#1)
	at
org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorRep
orter.java:98)
	at
org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.j
ava:85)
	at org.mozilla.javascript.Parser.addError(Parser.java:126)
	at org.mozilla.javascript.Parser.reportError(Parser.java:132)
	at
org.mozilla.javascript.IRFactory.createAssignment(IRFactory.java:1254)
	at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
	at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
	at org.mozilla.javascript.Parser.assignExpr(Parser.java:1241)
	at org.mozilla.javascript.Parser.expr(Parser.java:1224)
	at
org.mozilla.javascript.Parser.statementHelper(Parser.java:1111)
	at org.mozilla.javascript.Parser.statement(Parser.java:623)
	at org.mozilla.javascript.Parser.parse(Parser.java:355)
	at org.mozilla.javascript.Parser.parse(Parser.java:293)
	at org.mozilla.javascript.Context.compileImpl(Context.java:2238)
	at
org.mozilla.javascript.Context.compileString(Context.java:1284)
	at
org.mozilla.javascript.Context.compileString(Context.java:1273)
	at
org.mozilla.javascript.Context.evaluateString(Context.java:1129)
	at
org.apache.jmeter.functions.JavaScript.execute(JavaScript.java:80)
	at
org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.
java:128)
	at
org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.
java:97)
	at
org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(F
unctionProperty.java:85)
	at
org.apache.jmeter.modifiers.UserParameters.setValues(UserParameters.java
:137)
	at
org.apache.jmeter.modifiers.UserParameters.process(UserParameters.java:1
23)
	at
org.apache.jmeter.threads.TestCompiler.runPreProcessors(TestCompiler.jav
a:106)
	at
org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.jav
a:87)
	at
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:285)
	at java.lang.Thread.run(Unknown Source)

Ori Marko 
Quality Assurance Engineer 
Praxell Inc.
Mobile: 0524-455-177
Office:03-6126060 Ext 612
Fax: 03-6126066
http://www.praxell.com

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Tuesday, December 18, 2007 5:36 PM
To: JMeter Users List
Subject: Re: Jmeter+javascript issue

Check jmeter.log for errors.

I expect you will find a syntax error because of the unescaped comma

On 18/12/2007, Ori Marco <or...@praxell.com> wrote:
> Hi
>
> Just adding that It works in JavaScript on html and I tried and failed
> also to add '' to variable name as follow
>
> Value    ${__javaScript('${Value }'.replace(/^/g, "\^"))}
>
> Value    ${__javaScript('${Value }'.replace(/ /g,"%20"))}
>
> FYI
>
> Ori Marko
> Quality Assurance Engineer
> Praxell Inc.
> http://www.praxell.com
>
> -----Original Message-----
> From: Ori Marco [mailto:orim@praxell.com]
> Sent: Tuesday, December 18, 2007 12:28 PM
> To: JMeter Users List
> Subject: Jmeter+javascript issue
>
> Hi
>
>
>
> I want to assert http request with variable, but to do so I need to
> convert some chars in regular expression value:
>
>  ^,?,+ should be added \ before and space char should be convert to
%20
>
> e.g. Http request is: Param1=^ABC&Param2=A%20B%20C
>
> Regular expression value before conversion: Param1=^ABC&Param2=A B C
>
>
>
> What is the best way to convert?
>
> I tried to use JavaScript in User parameters component but failed (
> didn't replace any chars):
>
> Value    ${__javaScript(${Value }.replace(/^/g, "\^"))}
>
> Value    ${__javaScript(${Value }.replace(/ /g,"%20"))}
>
>
>
> What can be done to achieve this conversions?
>
>
>
> Thanks
>
> Ori Marko
> Quality Assurance Engineer
> Praxell Inc.
> Mobile: 0524-455-177
> Office:03-6126060 Ext 612
> Fax: 03-6126066
> http://www.praxell.com <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


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


Re: Jmeter+javascript issue

Posted by sebb <se...@gmail.com>.
Check jmeter.log for errors.

I expect you will find a syntax error because of the unescaped comma

On 18/12/2007, Ori Marco <or...@praxell.com> wrote:
> Hi
>
> Just adding that It works in JavaScript on html and I tried and failed
> also to add '' to variable name as follow
>
> Value    ${__javaScript('${Value }'.replace(/^/g, "\^"))}
>
> Value    ${__javaScript('${Value }'.replace(/ /g,"%20"))}
>
> FYI
>
> Ori Marko
> Quality Assurance Engineer
> Praxell Inc.
> http://www.praxell.com
>
> -----Original Message-----
> From: Ori Marco [mailto:orim@praxell.com]
> Sent: Tuesday, December 18, 2007 12:28 PM
> To: JMeter Users List
> Subject: Jmeter+javascript issue
>
> Hi
>
>
>
> I want to assert http request with variable, but to do so I need to
> convert some chars in regular expression value:
>
>  ^,?,+ should be added \ before and space char should be convert to %20
>
> e.g. Http request is: Param1=^ABC&Param2=A%20B%20C
>
> Regular expression value before conversion: Param1=^ABC&Param2=A B C
>
>
>
> What is the best way to convert?
>
> I tried to use JavaScript in User parameters component but failed (
> didn't replace any chars):
>
> Value    ${__javaScript(${Value }.replace(/^/g, "\^"))}
>
> Value    ${__javaScript(${Value }.replace(/ /g,"%20"))}
>
>
>
> What can be done to achieve this conversions?
>
>
>
> Thanks
>
> Ori Marko
> Quality Assurance Engineer
> Praxell Inc.
> Mobile: 0524-455-177
> Office:03-6126060 Ext 612
> Fax: 03-6126066
> http://www.praxell.com <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+javascript issue

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

Just adding that It works in JavaScript on html and I tried and failed
also to add '' to variable name as follow

Value    ${__javaScript('${Value }'.replace(/^/g, "\^"))}

Value    ${__javaScript('${Value }'.replace(/ /g,"%20"))}

FYI

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

-----Original Message-----
From: Ori Marco [mailto:orim@praxell.com] 
Sent: Tuesday, December 18, 2007 12:28 PM
To: JMeter Users List
Subject: Jmeter+javascript issue

Hi

 

I want to assert http request with variable, but to do so I need to
convert some chars in regular expression value:

 ^,?,+ should be added \ before and space char should be convert to %20

e.g. Http request is: Param1=^ABC&Param2=A%20B%20C

Regular expression value before conversion: Param1=^ABC&Param2=A B C

 

What is the best way to convert?

I tried to use JavaScript in User parameters component but failed (
didn't replace any chars):

Value    ${__javaScript(${Value }.replace(/^/g, "\^"))}

Value    ${__javaScript(${Value }.replace(/ /g,"%20"))}

 

What can be done to achieve this conversions?

 

Thanks 

Ori Marko 
Quality Assurance Engineer 
Praxell Inc.
Mobile: 0524-455-177
Office:03-6126060 Ext 612
Fax: 03-6126066
http://www.praxell.com <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