You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Selvam T, Palani" <Pa...@altisource.com> on 2011/07/06 16:59:07 UTC

String Replacement

Hi,

 

Using Regular expression extractor, I'm able to get User value as
"firstname lastname". But in next request, I've to pass like
"firstname+lastname". I tried javascript expression like below:

 

${__javaScript(${userName}.replace(/ /,"+"))}

 

It is not working.. How can I correct it?

 

 

Thanks & Regards,

Palani Selvam

 




*******************************************************************************************************

This E-mail message and its attachments, if any are intended solely for the use of the addressee hereof. In addition, this message and the attachments, if any may contain information that is confidential, privileged and exempt from disclosure under applicable law. If you are not the intended recipient of this message, you are prohibited from reading, disclosing, reproducing, distributing, disseminating or otherwise using this transmission. 


Delivery of this message to any person other than the intended recipient is not intended to waive any right or privilege. If you have received this message in error, please promptly notify the sender by reply E-mail and immediately delete this message from your system.  Instructions transmitted over this system are not binding on us until they are confirmed by us. Message transmission is not guaranteed to be secure or free of software virus. While Altisource Portfolio Solutions and its subsidiaries collectively "Altisource" takes every reasonable precaution to minimize such risks, Altisource cannot accept liability for any damage sustained by you or any third party as a result of software viruses.

*******************************************************************************************************


RE: String Replacement

Posted by "Selvam T, Palani" <Pa...@altisource.com>.
Felix,

You are right. I need to escape the comma char..==>
${__javaScript('${sValue}'.replace(' '\,'+'))}

Thanks & Regards,
Palani Selvam
 

-----Original Message-----
From: Felix Frank [mailto:ff@mpexnet.de] 
Sent: Wednesday, July 06, 2011 8:47 PM
To: JMeter Users List
Subject: Re: String Replacement

On 07/06/2011 05:14 PM, Selvam T, Palani wrote:
> It is not worked.. Is that Java script function, right?

The Javascript call should be all right.

However, I remember reading in the docs that commas need to be escaped.
Please look up the section about the Javascript function for more
information.

Cheers,
Felix

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




*******************************************************************************************************

This E-mail message and its attachments, if any are intended solely for the use of the addressee hereof. In addition, this message and the attachments, if any may contain information that is confidential, privileged and exempt from disclosure under applicable law. If you are not the intended recipient of this message, you are prohibited from reading, disclosing, reproducing, distributing, disseminating or otherwise using this transmission. 


Delivery of this message to any person other than the intended recipient is not intended to waive any right or privilege. If you have received this message in error, please promptly notify the sender by reply E-mail and immediately delete this message from your system.  Instructions transmitted over this system are not binding on us until they are confirmed by us. Message transmission is not guaranteed to be secure or free of software virus. While Altisource Portfolio Solutions and its subsidiaries collectively "Altisource" takes every reasonable precaution to minimize such risks, Altisource cannot accept liability for any damage sustained by you or any third party as a result of software viruses.

*******************************************************************************************************


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


Re: String Replacement

Posted by Felix Frank <ff...@mpexnet.de>.
On 07/06/2011 05:14 PM, Selvam T, Palani wrote:
> It is not worked.. Is that Java script function, right?

The Javascript call should be all right.

However, I remember reading in the docs that commas need to be escaped.
Please look up the section about the Javascript function for more
information.

Cheers,
Felix

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


RE: String Replacement

Posted by "Selvam T, Palani" <Pa...@altisource.com>.
It is not worked.. Is that Java script function, right?

Thanks & Regards,
Palani Selvam
 

-----Original Message-----
From: Felix Frank [mailto:ff@mpexnet.de] 
Sent: Wednesday, July 06, 2011 8:39 PM
To: JMeter Users List
Subject: Re: String Replacement

On 07/06/2011 05:07 PM, Selvam T, Palani wrote:
> will it work?

You tell me.

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




*******************************************************************************************************

This E-mail message and its attachments, if any are intended solely for the use of the addressee hereof. In addition, this message and the attachments, if any may contain information that is confidential, privileged and exempt from disclosure under applicable law. If you are not the intended recipient of this message, you are prohibited from reading, disclosing, reproducing, distributing, disseminating or otherwise using this transmission. 


Delivery of this message to any person other than the intended recipient is not intended to waive any right or privilege. If you have received this message in error, please promptly notify the sender by reply E-mail and immediately delete this message from your system.  Instructions transmitted over this system are not binding on us until they are confirmed by us. Message transmission is not guaranteed to be secure or free of software virus. While Altisource Portfolio Solutions and its subsidiaries collectively "Altisource" takes every reasonable precaution to minimize such risks, Altisource cannot accept liability for any damage sustained by you or any third party as a result of software viruses.

*******************************************************************************************************


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


Re: String Replacement

Posted by Felix Frank <ff...@mpexnet.de>.
On 07/06/2011 05:07 PM, Selvam T, Palani wrote:
> will it work?

You tell me.

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


RE: String Replacement

Posted by "Selvam T, Palani" <Pa...@altisource.com>.
Felix,

${userName} is a used-defined variable.. will it work?

Thanks & Regards,
Palani Selvam
 
-----Original Message-----
From: Felix Frank [mailto:ff@mpexnet.de] 
Sent: Wednesday, July 06, 2011 8:32 PM
To: JMeter Users List
Subject: Re: String Replacement

On 07/06/2011 04:59 PM, Selvam T, Palani wrote:
> ${__javaScript(${userName}.replace(/ /,"+"))}

Try quotes like ${__javaScript("${userName}".replace(/ /,"+"))}

Javascript doesn't get to see that you're handling a variable, Jmeter
will substitute the value as a string. You need to make it clear to
Javascript that this value is just that - a string.

HTH,
Felix

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




*******************************************************************************************************

This E-mail message and its attachments, if any are intended solely for the use of the addressee hereof. In addition, this message and the attachments, if any may contain information that is confidential, privileged and exempt from disclosure under applicable law. If you are not the intended recipient of this message, you are prohibited from reading, disclosing, reproducing, distributing, disseminating or otherwise using this transmission. 


Delivery of this message to any person other than the intended recipient is not intended to waive any right or privilege. If you have received this message in error, please promptly notify the sender by reply E-mail and immediately delete this message from your system.  Instructions transmitted over this system are not binding on us until they are confirmed by us. Message transmission is not guaranteed to be secure or free of software virus. While Altisource Portfolio Solutions and its subsidiaries collectively "Altisource" takes every reasonable precaution to minimize such risks, Altisource cannot accept liability for any damage sustained by you or any third party as a result of software viruses.

*******************************************************************************************************


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


Re: String Replacement

Posted by Felix Frank <ff...@mpexnet.de>.
On 07/06/2011 04:59 PM, Selvam T, Palani wrote:
> ${__javaScript(${userName}.replace(/ /,"+"))}

Try quotes like ${__javaScript("${userName}".replace(/ /,"+"))}

Javascript doesn't get to see that you're handling a variable, Jmeter
will substitute the value as a string. You need to make it clear to
Javascript that this value is just that - a string.

HTH,
Felix

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