The basic test creation method is record and playback. What does this really mean? Let’s talk about ‘Record’ first. When a tester launches QTP and performs a series of operations on the AUT (Application Under Test) QTP generates lines of code that correspond to each operation performed.
This will be the basic test script. Moving on to ‘Playback’. When the test script created is run, it performs the exact same operations on the AUT thus playing back the sequence of steps already recorded.
For Example, When I launch QTP and try to access the login page of a web-based email program, I enter the login ID, Password and press the OK button. These actions are recorded in their equivalent VBScript lines of code in the QTP IDE. When I save this test script and play it back, QTP will enter the same login ID, Password I entered before and clicks on the OK button for me.
Now this being the gist of the basic test creation technique, record and playback are not always sufficient to a robust test script. The tester will have to use the other features in the IDE in conjunction with a few of his programming skills to achieve the required results.
There are various technical aspects to be taken into consideration before we attempt to record and playback, like the state of the AUT, synchronization, the exact menu options, the exact code that QTP generates, etc. We will get to that as soon as we discuss the basic concepts of the tool itself.
Here’s how all this works. QTP identifies the various objects in the AUT by a name or handler ID or any other unique property/properties that the object possesses. During the recording phase, it captures all these properties and during playback, it performs the desired operations like a mouse click, checkbox checking, etc. on these objects.