| || |
Reusing script for all types of testing
Can I create a library of test scripts, with functions like:
and combine these as I need, using script, to create dynamic tests which can then be used as a load test task. I understand that load tests use http requests, not scripts, but can I not run the scripts as input for recording a task? If so, how?
We're looking for a low maintenance, flexible and comprehensive tool that will be easy to keep updated and provide for testing needs in the long term. So it's important that we can use the same scripts for function testing, smoke testing and load/stress testing.
Are there other tools that are more suitable for this?
Re: Reusing script for all types of testing
The two load testing tools that I have experience with (TestComplete and, on a VERY basic level, NeoLoad) both treat load testing the same way. I can't speak from experience for LoadRunner but I'd be willing to bet that the same holds true there.
Load Testing, by definition, is not a test of the functionality of the site/application but is a test of the site/applications ability to run smoothly under load. So, the design of load testing tools is not to interact with the UI and operate the site functionally, but instead to simulate the traffic to the site to determine it's ability to handle varying levels of traffic.
Script routines operate the UI. To have an application, on a single box, simulate 100+ users operating the UI, is not possible. It would mean you need 100+ windows open in your OS, each one of those windows executing mouse-clicks and keyboard keystrokes simultaneously. I don't know of anyway to make a mouse click on two seperate windows simultaneously much less 100+.
So, the initial answer is, no, you cannot take the script routines as they are and use them as a load test.
Now, that said, I know that there are some people that write the script routines and, when executing them on one box, have another box recording those actions into load testing request tasks. The end result is that those script routines are executing as the tasks but ultimately you still have two seperate pieces of code: the script routine and the load testing task.
You CAN record seperate tasks for each of the steps in the process. You can have a LogIn load testing task, a SearchProducts load testing task, and so on. For that matter, you can, using the OnLoadTestingRequest event handlers, trigger that, when a particular task is run and a particular request is sent, the recorded traffic is modified to be "dynamic".
If there is a tool out there that allows you to interchange functional test script routines with load testing traffic simulation, I don't know of it. I'm not an expert in ALL the available tools. But, due to the nature of what load testing is, I'd be very surprised if such a thing existed.
Automated Testing Evangelists
Definition expert - noun - Unknown drip under pressure
Re: Reusing script for all types of testing
I understand that functional testing and load testing are different. But my point is that when you're load testing you want to simulate the actual usage/load that the site is subjected to. The actual load is made up of the usage of your sites functionality, some functions being used more than others.
So I think it's strange that after you've created scripts for full coverage of your sites functionality that you can't (or at least, can't easily) build scripts that reuse the functional tests to simulate use cases, that can be used for smoke testing; And then create other sripts that, using combinations of the smoke testing scripts, can be used to generate the requests needed for runing a load test.
If this was possible, you could use event handlers to vary the input in the requests, and set some requests to repeat more often than others. That way you would have a resusable library of tests that were the base for all your testing. Admittedly you would still have to configure the load tasks each time they're regenerated - but even there you could build a library of scripts based on usage statistics values and their relation to requests. Each request could be associated with it's latest "page hit" statistics, and have associated arrays of values to randomize it's input.
You mention that there are "some people that write the script routines and, when executing them on one box, have another box recording those actions into load testing request tasks", so I suppose that is what I will do if I don't find a tool that can do it for me on a single box.
I'm just suprised that the tools aren't built to support this more easily.
Thanks again for your reply.
It seems that I will probably become one of the "some people" that you refer to above!