For that reason many performance testing tools (including VSTS) provide simple solution to this common problem – transactions.
Since it would be difficult (if not impossible) for a testing tool to automatically add the transactions it is something what needs to be done manually before a meaningful test can be executed.
Having said that it will still be possible to execute a load test without addin in transactions although some manual calculations will have to be done to figure out how much time each user action takes.
It is important to define transactions in the same way if the scripts needs to be rerecorded otherwise the results of different test executions cannot be directly compared.
In order to define transactions the WebTest:
- Right click on the first request or comment which doesn't belong to any transaction
- Select "Insert Transaction…" from the context menu
- Enter transaction name; see transaction naming convention below
- Select first request or comment for this transaction; this will be already preselected to the request on which "Insert Transaction…" has been clicked
- Select last request for this transaction; if you followed this guide closely it will be the last request before next comment
- Click OK
- Repeat steps 1 to 6 for remaining requests
New transaction will be added to the WebTest with the chosen requests. If for any reason the transaction is not as intended (i.e. missing requests or too many requests) it is possible to manually drag and drop requests in and out of the transaction.
It is considered a good practise to adhere to a transaction naming convention. The naming convention which I find particularly helpful during could be defined as ShortScriptName_Index_TransactionName
Based on that convention transaction names could look as follows:
Using this naming it is possible to sort transaction by name while viewing test results and then follow transaction times in the execution order.
For the full guide to developing VSTS WebTests please refer to the Using Fiddler with VSTS.