jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel L. Gregoire" <dlg.toast...@gmail.com>
Subject Re: Replacing &amp; with an &
Date Tue, 29 Aug 2006 01:04:22 GMT
Oliver Erlewein (DSLWN) wrote:
> Hi all,
>
> My problem is, that I extract (via post processor regular expression) a
> portion of a form tag from a returned HTTP page. The content is
> something like...
>
> https://www.xxxx.co.nz/Admin/AdminRegister/ApplicationForm.aspx?pp_DocFi
> leId=-1&amp;pp_PageEnvironment=-1&amp;pp_PrevNavNode=Vert%253aApply&amp;
> pp_IsReadOnly=False&amp;pp_RequestId=-1&amp;pp_ViewMode=Default 
>
> Now this needs to get POSTed in the next response. The problem is, that
> browsers apparently do an automatic decode of the link in the action tag
> of a form converting the &amp; to an &. JMeter doesn't (which is the
> correct behaviour!). Now I've looked at the documentation and can't come
> up with a proper solution of how I can replace string portions (without
> using Java Beans which I know nothing about .....yet). Maybe someone has
> solved this problem before?! I also had a look in the archives but I
> haven't found anything relevant.
>
> Thanks!
> Oliver 
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
>   
Here's a bit of JavaScript that takes care of the problem.  I got this
from somewhere in the archives.

${__javaScript('${yourVariable}'.replace(/amp;/g\,"))}

yourVariable being the value of the Regex Postprocessor you're trying to
decode.  Make sure to include the quotes around your variable if the
value itself does not have quotes.

Regards,
Daniel

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


Mime
View raw message