Performance Testing, LoadRunner Tips&Tricks

This site is moving to a bigger space @ LoadRunner TnT

Scripts: Starting a new transaction during iterations

Recently one of my load testing projects required us to monitor the time taken to upload a file into the application. This sounds simple and straight forward with the implementation of the lr_start_transaction and the lr_end_transaction. However, the catch is that the action block be iterated 10 times and within the 10 iterations, one of the iteration is to upload a different file of different size (thus causing different response time), which they want to measure.

What we did was implement a if-then-else to check the file and perform a lr_start_transaction when the script is uploading the different file and end the transaction with the lr_end_transaction when the submission completes. The snippet of the code is as followed:


if (!strcmp(lr_eval_string("{file}"), lr_eval_string("{set_file}")))
{
lr_start_transaction("tx_check_upload_different_file");
}
else
{
lr_start_trasaction("tx_tx_check_same_upload_file");
}
...
...
\\other codes
...
...
if (!strcmp(lr_eval_string("{file}"),lr_eval_string("{set_file}")))
{
lr_end_transaction("tx_check_upload_different_file",LR_AUTO);
}
else
{
lr_end_trasaction("tx_check_same_upload_file",LR_AUTO);
}

The code detects the if the uploaded file is different and will start tracking the timing for the upload transaction. Hope it's useful to you.


Related Topics

Scripts: Duplicating Files on the Fly

Scripts: Step Download Timeout

Scripts: VIEWSTATE

Scripts: Auto or Manual Correlation?

Scripts: Remove Think Time

Scripts: Set Debug Mode in Script

Scripts: Replay Failure – Use Full Extended Log!







Labels: , , , , ,


Bookmark this article now! AddThis Social Bookmark Button



technorati del.icio.us reddit digg

0 Responses to “Scripts: Starting a new transaction during iterations”

Post a Comment


Powered by Google

Enter your email address:

Delivered by FeedBurner


Add to Technorati Favorites


XML

Powered by Blogger

make money online blogger templates

Powered by FeedBurner

Blog Directory

Top Blogs

Software Blogs -  Blog Catalog Blog Directory





© 2007 Performance Testing, LoadRunner Tips&Tricks | Blogger Templates by GeckoandFly.
No part of the content or the blog may be reproduced without prior written permission.
Learn how to make money online | First Aid and Health Information at Medical Health