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.

>
> 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 
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.

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','')

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. 
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."

Hope this proves helpful.

Regards,
Mamading.

-- 
Qmediastream http://qmediastream.com
design, commerce, hosting, streaming, multimedia

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

Reply via email to