[Http-webtest-general] Re: webtest
Brought to you by:
m_ilya,
richardanderson
From: Duncan C. <dca...@bc...> - 2002-06-09 07:39:30
|
On 2002-06-08 Ilya Martynov wrote: >>>>>> On Sat, 08 Jun 2002 13:57:49 +0100, Marc Rogers <ma...@cl...> said: > >MR> Hi > >Hi, > >Please post questions about HTTP::Webtest to maillist so others can >benfit from answers. > >MR> I have a minor issue with HTTP::Webtest. > >MR> Due ot the way a site i am working on manages sessions, I need to be >MR> able ro insert a variable parameter into the middle of the test >MR> url. This is becuase the site uses a jsp based session management >MR> system which creates a unique context for the users session: > >MR> ie: if the user is assigned a session of !caa8Dp1BzY, then his url will be: >MR> http://site.url/!caa8Dp1BzY/login.jsp > >MR> now I can easily capture the session id using the id example in your >MR> cookbook, and pass this to a parameter, but I cant seem to insert it >MR> into the url. I assume this is parsed and thrown out to the user >MR> agent. is there any contingency for this in the module, or am I going >MR> to have to hack it in? > >As I understand you are using latest development release (1.99_06). > >Something like > >test_name = Login > url = { "http://site.url/$SESSION_ID/login.jsp" } > ... > ... >end_test > >should work (assuming that $SESSION_ID contains session id captured >earlier). > >Note that just > > url = "http://site.url/$SESSION_ID/login.jsp" > >doesn't work. You have to put string into curly braket to force >evalutaion of Perl variables in string. > >Actually it is already changed in CVS and with CVS version > > url = "http://site.url/$SESSION_ID/login.jsp" > >does works. I'm going to release it as soon as I fix bugs introduced >by rewrite of parser. > >-- >Ilya Martynov (http://martynov.org/) > Along similar lines I am playing around with webtest as a client to a .Net server. Net uses a similar approach for passing state around by a hidden field in each form called '__VIEWSTATE'. The webtest client has to include this hidden field in the parameters POSTed back to the server. I've written a small webtest plugin to extract the viewstate from each response and add then add it as an extra parameter in each POST. It's similar to the Click plugin but uses HTML::Form to extract the hidden field. If anyone's interested in seeing it then let me know. Regards, Duncan Cameron |