Since this is not a very widely used feature, I am going to do a high level introduction here.
Typically, a test is divided into transactions when you have to measure how long it takes to run a certain section of it.
It is also used when a QTP test is to be used by Load Runner or Business Process Monitor. In either of these cases, your test has to be recorded in terms of a transaction and anything outside of it will be ignored.
You can start a transaction from QTP using “Insert->Start Transaction”. Give it a name, choose if you want it before or after the current step and choose OK.
Services.StartTransaction “TransactionTest” – Gets inserted. Now I will record a login into Gmail.com.
Once you are done recording. Choose “Insert->End Transaction”. Click OK.
Services.EndTransaction “TransactionTest” – gets inserted.
This is the code:
Now I will run this test. Let us see how the test results look. The results will show a summary in terms of time taken to finish the transaction.

No comments:
Post a Comment