views:

860

answers:

10

My team has just developed a website for a client and wants to test that it'll work under the expected usage for 50 simultaneous users. So the plan is to write a test program that will act as 50 simultaneous users. We need this test program to be able to:

  1. Be logged in with a cookie. Our session ids are not embedded in our URLs and we don't want them to be.

  2. Submit a few forms rather than just clicking on links.

  3. Measure the response time of every page and keep statistics on every page; average, best, and worst load times would be nice.

  4. Wait a realistic amount of time between actions.

I don't need to worry about these clients doing anything with Javascript; our site only uses a little Javascript and the clients should be able to do almost everything without it.

So before we try to build our own software for doing this, is there something out there which would meet some or all of these needs? A Python solution would be ideal, but we'll take anything, so long as it's free. (We have a budget for programmer time but no budget for buying software, so it wouldn't matter how money we'd save to buy a COTS product.)

EDIT: I've gotten several great suggestions below. Watir looks like the easiest and most elegant solution. Unfortunately, all of the solutions seem to require that a client hits a pre-specified series of webpages in a specific order. What I'd like is something that clicks on random links and submits random forms to simulate a bunch of users clicking on a bunch of links. Nothing so far seems to make this easy, although Watir comes the closest.

+1  A: 

the Microsoft Web Application Stress Tool should cover some of your needs.

Mike
+2  A: 

http://wtr.rubyforge.org/ I think that's all you need to know. I Googled "watir phython" and got some interesting hits but you could do that...

I would add that I'm a .NET developer and had very limited exposure to Ruby before trying Watir (decided not to use the crutch of Watin, the .NET port first) and I picked it up enough to do my testing. I have since started using Watin for the integration it gives me.

I've used Microsoft's free WAST in the past and it is probably good enough for basic testing even if it is Circa 2002.

brettbaggott
+2  A: 

Take a look at selenium I think that it might be able to somehow act as multiple users at once.

George Mauer
Selenium is good but not really for stress testing. It doesn't provide a way of doing multiple user sessions at the same time.
Paul Mendoza
Yeah, selenium is good for functionality testing - not load.
flybywire
Well selenium grid can be used for using your selenium tests that already do integration testing for load testing EDIT: Nevermind, they recommend browser mob for this http://selenium-grid.seleniumhq.org/faq.html#would_you_recommend_using_selenium_grid_for_performanceload_testing
scottschulthess
+1  A: 

Also, wget allows you to pass cookies in.

changelog
+7  A: 

I've found Apache Jmeter (http://jakarta.apache.org/jmeter/) to be an awesome tool for this. It's easy to get up and running with, and helped me narrow in on exactly the functions I wanted to test.

Buzz
+1  A: 

Have a look at PureLoad

EDIT: PureLoad is not free software. Not that there's anything wrong with that, but it may remove it from consideration for many teams.

Kristian
+3  A: 

Since Watir is "just" a Ruby (nice programming language) library, you can create tests that will randomly click links and submit random forms.

Take a look at this page for example:

http://wiki.openqa.org/display/WTR/Dynamic+Method+Creation

Also, if you decide to use Watir, you can get help at http://groups.google.com/group/watir-general

Just to be open about it: I am member of Watir core team.

Željko Filipin
+1  A: 

Someone has already mentioned Apache JMeter, which I would recommend highly. Having said that, I would also recommend ab - Apache HTTP server benchmarking tool.

ayaz
+1  A: 

We use openSTA for that sort of testing.

tloach
+1  A: 

Agree with openSTA suggestion.

This allows a session with a web site to be recorded and then played back via a relatively simple script language.

You can easily test web services and write your own scripts.

This script could use a "random" function to choose between a number of URL's and then send the page to that URL.

It's open source and free.

nzpcmad