You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Philippe Simon <ps...@dexem.com> on 2001/06/20 10:16:10 UTC

Tests dynamic web site

Hye everubody. I'm new to this list.

I'd like to test (load test) my web site. Web pages are created
dynamically.

To simulate a user behavior, I have to simulate a login phase and then
display a few web pages, The web application I use, add some hidden
field to the login form. These hidden field are dynamically generated by
the web application.

Is there a way with Jmeter to :
    - first get the login page and store these hidden fields  (with a
Jmeter Webtesting Controller)
    - second validate the login form by reusing the hidden fields
previuosly received in the login form. (with another Jmeter WebTesting
controller)

Thanks


--
Philippe Simon   -   dexem
Email : mailto:psimon@dexem.com



Re: Tests dynamic web site

Posted by Mike Stover <ms...@apache.org>.
There is a way to do this, but not "out of the box'".  It will require a 
little programming.

If you'll note, the SamplerController interface includes a method called 
"getListeners()".  The purpose of this method is to allow SamplerControllers 
to add themselves as listeners to SampleEvents.  

If you were to make your own SamplerController that added itself as a 
SampleListener within its getListeners method, and your SamplerController 
implemented the SampleListener interface, you would receive every 
SampleEvent, which contain SampleResults, which contain the HTML text 
returned from the web server.  You could easily parse that text for the one 
piece of data you are looking for, and your controller could explicitly 
manipulate every Entry that passed through it, grabbing the UrlConfig object 
from it, and adding the parameter you parsed from the web page.  

Granted, you've now made a very specific change just for your application, 
but it's very little work to do this.  All you really have to do is subclass 
HttpTestSample and override it's getListeners, implement the SampleListener 
interface, and override the createEntry(UrlConfig config) method (which is 
currently private - you'd have to change it to protected).

Good luck, and let me know if you need any more help!

-Mike

On Wednesday 20 June 2001 08:16, Philippe Simon wrote:

> > Hye everubody. I'm new to this list.
>
> I'd like to test (load test) my web site. Web pages are created
> dynamically.
>
> To simulate a user behavior, I have to simulate a login phase and then
> display a few web pages, The web application I use, add some hidden
> field to the login form. These hidden field are dynamically generated by
> the web application.
>
> Is there a way with Jmeter to :
>     - first get the login page and store these hidden fields  (with a
> Jmeter Webtesting Controller)
>     - second validate the login form by reusing the hidden fields
> previuosly received in the login form. (with another Jmeter WebTesting
> controller)
>
> Thanks
>
>
> --
> Philippe Simon   -   dexem
> Email : mailto:psimon@dexem.com

----------------------------------------
Content-Type: text/html; charset="us-ascii"; name="Attachment: 1"
Content-Transfer-Encoding: 7bit
Content-Description: 
----------------------------------------

-- 
Mike Stover
mstover1@apache.org

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