tags:

views:

104

answers:

2

Hi, I am solving an issue that I cannot figure out. I need to login and click repeteadly (thousand of times) on the specific link to create some load. I know I should use HTTP/PHP for that but do not know how to solve the login? My next idea was to use some packet sniffer and re-send the requests..but will it work when I would close the browser? Thanks

+4  A: 

If you'd want to do this from a PHP script, you could use cURL to simulate the HTTP request. However, it is easier to use a benchmark tool like ab or siege to put load on certain URLs

With ab:

ab -n 1000 -c 10 http://www.example.com/login.php

From the Siege website:

Siege is a regression test and benchmark utility. It can stress test a single URL with a user defined number of simulated users, or it can read many URLs into memory and stress them simultaneously. The program reports the total number of hits recorded, bytes transferred, response time, concurrency, and return status. Siege supports HTTP/1.0 and 1.1 protocols, GET and POST directives, cookies, transaction logging, and basic authentication. Its features are configurable on a per user basis.

Also see this related question

Gordon
+1  A: 

Take a look at Selenium. You may record an action and then edit the resulting script into a loop.

djn
Yes, but while you *could* use Selenium for this, it's intention is for testing frontends, while the OP seems to want to test the capacity of the server, in which case Selenium is not the right tool for the job.
Gordon