Question

I've read about load testing and the tools that can be used to implement it on a web application. I'm using apache ab. Let it be any other tool, but my question is how do you load test specific pages without actually logging into the web application ?

How do you know the response time of each page by simply using " ab -k -n 500 -c 10 http://abc.xyz.com/" when the real one to be tested is " ab -k -n 500 -c 10 http://abc.xyz.com/index.html" which is accessible only if you log in ?

Was it helpful?

Solution

You should first get the authorization cookie manually (using curl, for example), then just add it to headers. We use Yandex.Tank for most of our load testing tasks. Here's an example of load.ini for your case:

[phantom]
address = abc.xyz.com
rps_schedule = line (1, 120, 15) const (120, 10m)
header_http = 1.1
headers = [Host: abc.xyz.com]
  [Connection: close]
  [Cookie:<here goes auth cookie>]
uris=/index.html

I think you could also do something similar with ab or jmeter.

OTHER TIPS

Let it be any other tool, but my question is how do you load test specific pages without actually logging into the web application ?

The short answer is: No, you can not. If you could, then the application would have a big security hole, right?

You need to login, get the authorization token / session ID (probably a cookie) and send that in future requests.

If you want to test with a large number of concurrent virtual clients, each doing login and a bunch of actions, you may want to try some performance test tools that can emulate a real user. On NetGend test platform, the following example script will emulate a user by filling the html form and do some actions. (NetGend use javascript syntax)

quickForm("http://www.example.com/login?", ["jsmith", "abc123"]);
//do action after login
//get a list of productIDS
prodId = randElement(productIDS);
action(http,"http://www.example.com/view?product=${prodId}");

NetGend test platform doesn't only make interaction with web site easier, it can emulate a large number of clients - for example, you can feed it with a csv file with 50,000 user/password combo.

If you have time, you may want to check out many blogs on many test scenarios.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top