Re: Performance Expectations

"Wolfgang Fahl" <[email protected]> Tue, 18 Aug 2009 18:59:12 +0200
Newsgroups gmane.comp.web.httpunit.devel
Organization BITPlan GmbH
Message-ID <[email protected]>
Andy,

you might want not to login for each and every test.
It would be adivsable to login once and keep the 
connection to TomCat open for all tests and start 
directly after the login page. You might want to make 
sure there is an option for your app to clear it's state 
without login in.

If you do not keep your connection open TomCat will have 
to reload everything from scratch, setup a whole 
environment and so on depending on what you do. This 
might take a lot of time as you've found out.

Just my two cents ...

Wolfgang
> 
> Hello,
> We've been using HTTPUnit in our Software Engineering class for a few 
> years now, and we're pretty happy with it. However, our http tests are 
> pretty slow. We know that the system itself is not particularly slow - 
> our regular unit tests pass quickly and the application itself is not 
> slow. In particular, our login utility method seems to be a major 
> contributor:
> 
> public WebConversation login(String username, String password) throws 
> Exception {
> //...some code...
> WebConversation wc = new WebConversation();
> WebResponse loginResponse = wc.getResponse(ADDRESS);
> 
> WebForm form = loginResponse.getForms()[0];
> form.setParameter("j_username", username);
> form.setParameter("j_password", password);
> 
> WebResponse homePage = loginResponse.getForms()[0].submit();
> //....more code...
> 
> This chunk of code takes 3-4 seconds each time. Each of the two http 
> requests are about 1.5-2 seconds. For a 120 tests it takes about 8-10 
> minutes. We'd really like to speed it up if we can.
> 
> We're using Tomcat as our server. I've tried things like disabling 
> "acceptGZip", disabling scripting (which is not always an option), and 
> accepting images as an alt text - no change. Am I missing a parameter I 
> can tune? Is there a way I can further diagnose the problem?
> 
> Thanks!
> 
>  -Andy
> 



BITPlan - smart solutions
Pater-Delp-Str. 1, D-47877 Willich Schiefbahn
Tel. +49 2154 811-480, Fax +49 2154 811-481
Web: http://www.bitplan.de
bitplan GmbH, Willich - HRB 6820 Krefeld, VAT-ID: 10258040548, 
Geschäftsführer: Wolfgang Fahl

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop