In QTP, what command is used to insert the transactions in test?

  1. Services.StartTransaction "Name", Services.EndTransaction "Name";

  2. StartTransaction.Services “Name”,EndTransaction. Services "Name";

  3. StartTransaction ("Name"), EndTransaction ("Name");

  4. Services.StartTransaction "Name", EndTransaction. Services "Name";


Correct Option: A

AI Explanation

To answer this question, you need to understand how to insert transactions in a test in QTP (QuickTest Professional).

The correct command to insert transactions in a test in QTP is:

A. Services.StartTransaction "Name", Services.EndTransaction "Name";

This option is correct because it uses the correct syntax to start and end a transaction. The StartTransaction command is used to begin a transaction with a specified name, and the EndTransaction command is used to end the transaction with the same name.

Option B is incorrect because it uses the incorrect syntax for starting and ending a transaction. The StartTransaction and EndTransaction commands should be called on the Services object, not the other way around.

Option C is incorrect because it uses parentheses incorrectly. The correct syntax does not require parentheses around the transaction name.

Option D is incorrect because it swaps the order of the StartTransaction and EndTransaction commands. The StartTransaction command should come before the EndTransaction command.

Therefore, the correct answer is A. Services.StartTransaction "Name", Services.EndTransaction "Name".

Find more quizzes: