You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Bob Brown <bo...@transentia.com.au> on 2007/03/21 12:50:05 UTC

Using Jmeter with Spring Webflow

Hi all,

I am attempting to use Jmeter with spring webflow
(http://www.springframework.org/webflow) ...and not having too much luck.

I have successfully recorded an interaction but cannot replay it.

The issue is that SWF dynamically generates an unique, one-shot token *for
each request*...something like a jsessionid, but "more so". For instance, a
sequence of POSTs would involve:

/TCE/scripting.spring?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA
3D_kE977CB0B-47FE-3319-A688-FE4F4FFFCE28
/TCE/scripting.spring?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA
3D_kDF3325D3-534C-C7B3-C373-6A3821F7316C
/TCE/scripting.spring?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA
3D_k96EF359D-DE48-E18F-6132-9A3D01EA0B9A
Etc...

The system also uses GET after POST, so a POST:

/TCE/scripting.spring?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA
3D_kE977CB0B-47FE-3319-A688-FE4F4FFFCE28

Is followed by a redirect/GET:

/TCE/scripting.spring?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA
3D_kDF3325D3-534C-C7B3-C373-6A3821F7316C

This adds extra complexity.

I have tried asking on the SWF list
(http://forum.springframework.org/showthread.php?t=35307) but this is
probably the 'proper' place to ask.

I have slaved over hot electrons for quite a while now and I am darned if I
can make progress.

I have added an "HTTP URL Re-writing Modifier" for _flowExecutionKey
(I have also tried adding a separate one for jsessionid). I have also added
an "HTTP Cookie Manager"

I attach a zipped JMeter run I did...perhaps someone could be kind enough to
give it a quick look and advise me how best to proceed.

Suggestions/etc. gratefully received.

Cheers,

Alph

Re: Using Jmeter with Spring Webflow

Posted by sebb <se...@gmail.com>.
On 21/03/07, Alf Høgemark <al...@i100.no> wrote:
> Hi
>
> I have used Jmeter to test Spring Webflow applications.
> I did not record the test via the proxy server, but built it from hand.
>
> Here are my suggestions.
> I use a cookie manager.
> I add a Post Processor->"Regular Expression Extractor" as a child to the
> first HTTP request which starts the "webflow".
> That "regular expr. extractor" looks like this :
>
> Reference name : flowId
> Regular Expression : name="_flowExecutionId" value="(.+?)"
> Template : $1$
> Match no : 0
> Default value : dummy   (I use this just see if I'm not able to extract
> the value
>
> Then on all subsequent HTTP requests for the same "flow", I have a
> request parameter :
> with name _flowExecutionId and value ${flowId}
>
> This means that when the flow starts, you will pick up the dynamically
> generated flowId, and it will be used in all subsequent requests in the
> same flow.

I think this is effectively what the HTTP Url rewriting modifier
should do ... but the problem is that the Proxy made some mistakes,
see below.

> This means you will have to do a little bit of manual work, after
> capturing the the test plan via the proxy server.
> I also think you should remove the
> "?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA3D_kE977CB0B-47FE-3319-A688-FE4F4FFFCE28"
> from the  "Path" of each request.
> You should not have the parameter both in the URL and as a request
> parameter in the table in the HTTP Request.
> I think I'll look into improving the HTTP Proxy Server, so that it
> removes the parameter from the URL, but for now, you have to do it by hand.

I've now had a look at the test plan, and it looks as though the proxy
correctly extracts the parameters from the request, but where there is
more than 1 parameter it seems to leave the _flowExecutionKey in the
path - as well as generating a parameter for it - which is clearly
wrong.

If that was fixed, the plan would have been better, but still not
ideal, because it would still have the _flowExecutionKey parameter on
each sample.

So it would be useful if the Proxy could be told not to save the
values of certain parameters in the generated test plan - i.e. the
parameters which we know need to be generated at run-time. [It would
need to remove these after the sample had been used to return the data
to the browser, of course]

S.

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


Re: Using Jmeter with Spring Webflow

Posted by Alf Høgemark <al...@i100.no>.
Hi

I have used Jmeter to test Spring Webflow applications.
I did not record the test via the proxy server, but built it from hand.

Here are my suggestions.
I use a cookie manager.
I add a Post Processor->"Regular Expression Extractor" as a child to the 
first HTTP request which starts the "webflow".
That "regular expr. extractor" looks like this :

Reference name : flowId
Regular Expression : name="_flowExecutionId" value="(.+?)"
Template : $1$
Match no : 0
Default value : dummy   (I use this just see if I'm not able to extract 
the value

Then on all subsequent HTTP requests for the same "flow", I have a 
request parameter :
with name _flowExecutionId and value ${flowId}

This means that when the flow starts, you will pick up the dynamically 
generated flowId, and it will be used in all subsequent requests in the 
same flow.

This means you will have to do a little bit of manual work, after 
capturing the the test plan via the proxy server.
I also think you should remove the 
"?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA3D_kE977CB0B-47FE-3319-A688-FE4F4FFFCE28" 
from the  "Path" of each request.
You should not have the parameter both in the URL and as a request 
parameter in the table in the HTTP Request.
I think I'll look into improving the HTTP Proxy Server, so that it 
removes the parameter from the URL, but for now, you have to do it by hand.

I do not think you need to do any handling og the jsession either. If 
you are using a CookieManager, the session will be kept via a cookie.
I think you should capture the plan without "capture http headers", just 
like you have done.

So my suggestion is to ditch the "HTTP URL Re-writing Modifier ", and 
use the expression extractor instead.

I'll attach an excerpt from my test plan, hope that helps.

Alf

Bob Brown wrote:
> Hi all,
>
> I am attempting to use Jmeter with spring webflow
> (http://www.springframework.org/webflow) ...and not having too much luck.
>
> I have successfully recorded an interaction but cannot replay it.
>
> The issue is that SWF dynamically generates an unique, one-shot token *for
> each request*...something like a jsessionid, but "more so". For instance, a
> sequence of POSTs would involve:
>
> /TCE/scripting.spring?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA
> 3D_kE977CB0B-47FE-3319-A688-FE4F4FFFCE28
> /TCE/scripting.spring?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA
> 3D_kDF3325D3-534C-C7B3-C373-6A3821F7316C
> /TCE/scripting.spring?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA
> 3D_k96EF359D-DE48-E18F-6132-9A3D01EA0B9A
> Etc...
>
> The system also uses GET after POST, so a POST:
>
> /TCE/scripting.spring?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA
> 3D_kE977CB0B-47FE-3319-A688-FE4F4FFFCE28
>
> Is followed by a redirect/GET:
>
> /TCE/scripting.spring?_flowExecutionKey=_c1E11178E-485F-3913-98BA-86E17A09FA
> 3D_kDF3325D3-534C-C7B3-C373-6A3821F7316C
>
> This adds extra complexity.
>
> I have tried asking on the SWF list
> (http://forum.springframework.org/showthread.php?t=35307) but this is
> probably the 'proper' place to ask.
>
> I have slaved over hot electrons for quite a while now and I am darned if I
> can make progress.
>
> I have added an "HTTP URL Re-writing Modifier" for _flowExecutionKey
> (I have also tried adding a separate one for jsessionid). I have also added
> an "HTTP Cookie Manager"
>
> I attach a zipped JMeter run I did...perhaps someone could be kind enough to
> give it a quick look and advise me how best to proceed.
>
> Suggestions/etc. gratefully received.
>
> Cheers,
>
> Alph
>   
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org