Hi
try
${__javaScript(vars.get("DataPointStr_" + ${dpIndex}).replace("
search.website.com"\,""),newVar)}
usually people forget to escape commas (the one in the replace function has
to be escaped  otherwise the parser thinks that the first parameter has
ended

>also, there may be some otherapproach
If you are extracting this out using a regex post processor then you might
want to use a different template/matching group so that you get what you
want . i.e. if your original regex matched href and extracted everything ,
you could modify your regex to only pick up data after the first slash in
the url. Im not sure if this will work for you because I dont know how you
got this data and whether you also need the original form

regards
deepak


On Mon, Jan 3, 2011 at 12:48 PM, romano <[email protected]> wrote:

> Hi All,
>   I am new to jmeter, I have a jmeter variable
> ${__V(DataPointStr_${dpIndex})}
> that has a value of "search.website.com/used/productmatches.asp?
> r=1&pean=096459823X&CND=5" which I need to do either substring from the
> slash /
> up to the end of the string or replace/truncate the search.website.comwith a
> null value.
>
> I've been trying this 2 approaches but I can;t make it to work:
> ${__javaScript('${__V(DataPointStr_${dpIndex})}'.substring(1,6,newVar))}
>
> ${__javaScript(('${__V(DataPointStr_${dpIndex})}}'.replace
> ('search.barnesandnoble.com','')),newVar)}
>
> I've been trying them to either from the UDF and to the Path on HTTP
> request
> but hasn't fot any luck.
>
> I thank you in advance for looking onto this. Also, there may be some other
> approach that you may suggest and I really appreciate your help.
>
> Regards,
> Romano
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to