On 07/02/06, Mamading Ceesay <[EMAIL PROTECTED]> wrote:
> On Tuesday 07 February 2006 17:47, sebb wrote:
> > Fine if you can do that, but seems like overkill when one can
> > potentially use BeanShell to extract and / or manipulate the
> > variables.
>
> If there is a better way like what you suggest then I'm all ears.

Better is subjective ...

>
> >
> > JMeter can extract the variables using the Regex Post-Processor.
> >
> > AFAIK, it can provide form parameters using JMeter variables.
> >
> > All that is missing is the step to convert the contents of the
> > variables. This could be done with a BeanShell function (at least
> > initially)
> >
> > Later this could be added as a new function. These are relatively easy to
> > write.
> >
>
> I considered the Regex Post-Processor, but I think may have had the wrong idea
> about where it goes.  I suppose I can attach it to the Http Request that GETs

Yes, they should be attached to the GET request.
There needs to be one for each string.
The matched data are saved in variables (which can be anything).

> the form, hmm.  I'm not clear on how and where I use the BeanShell function,
> despite having looked at the docs a hell of a lot.  I think I've spent so
> much time looking at them recently it's just not sinking in anymore.

Functions are used anywhere that variables can be used.

e.g. on the Sampler to provide a value for a parameter.

> Here's a concrete example that one of my colleagues came up with:
>
> Start of quote
>
> "Your modifications look fine. The problem is, AFAICS, that the javascript
> magic in Blah has changed since I wrote the bot. The original blah had a
> "create baz" link of the form:
>
> javascript:__doPostBack('lnkCreateBaz','')
>
> Now it is:
>
> javascript:__doPostBack('FooOrgAdministratorLeftMenu1$CreateFooLinkButton','')
>

Not sure I understand this, but it sounds as though the URL for the
postback request has changed. Unless this varies for each postback,
this is a one-time fix to the postback sampler.

> Since the interface to the engine has changed, blahbot is no longer able
> to talk to the blah server. The real problem here is that a hidden form
> is filled out using javascript -- the first argument is the "event target"
> and needs to be rewritten with ':' for each '$' then saved in the form.

This is where the function comes in - it would translate a$b$c to
a.b.c (or whatever).

> For example:
>
> ----------------------------------------------------------------------------
>
> if ($key eq "__EVENTTARGET")
> {
>   my $et = 'FooOrgAdministratorLeftMenu1$CreateFooLinkButton';
>   $et =~ s/\$/:/g;
>   $form->{$key} = $eg;
> }"
>
> End of quote
 > Another example, this time taken from the article I linked to previously:
>
> "The format of the ViewState is issued t o t h e browser in literal
> characters. There are numerous encoded values in t h e ViewState , each
> delimited by "+" . The server, however , expects to receive the ViewState
> back with special characters replaced w i t h their ASCI I equivalent . The
> only special character that is observed to be dynamic in the ViewState string
> is the delimiter " + " , represented in a post body or URL query string as
> "%2B" .
>
> Thus, before the captured ViewState can be successfully used, each of these
> "+" symbols that are interspersed in the string must be substituted with
> "%2B" . This can be reformatted by passing the value obtained by t h e " LOAD
> RESPONSE_INFO" command t o a subroutine held in an " Include" file."

This is not the same transformation as $ -> . above, but can be done.

If you know javascript, you could use the Javascript function instead
of teh BeanShell function.

> Hope this proves helpful.

Ditto.

> Regards,
> Mamading.
>
> --
> Qmediastream http://qmediastream.com
> design, commerce, hosting, streaming, multimedia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to