In this guide, we will dive deep into different recording modes, Object Spy, and Object Repositories in QTP.
=> Check the complete QTP Training Tutorials Series Here
Recommended IPTV Service Providers
- IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
- IPTVRESALE – Rating 5/5 ( 200+ Reviews )
- IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
- IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
- IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
- IPTVTOPS – Rating 5/5 ( 43 Reviews )
Recording Techniques in QTP
The recording process is a popular method for constructing tests. Initially, the fundamental steps are documented, followed by refinement of the test to meet the demands of the testing procedure.
Dive Into QTP Recording Modes
QTP provides 3 recording modes:
- Standard
- Detailed
- Simulated
The standard recording mode is frequently used, but it’s also useful to understand the other modes for any potential need.
Standard Recording mode: This is the default method of recording. In our past articles, when we spoke about recording, we actually referred to this standard mode. This approach employs the Test Objects and Runtime Objects model to learn and engage with the application undergoing testing (AUT).
Simulated Recording mode: Captures precise mouse and keyboard inputs given by the user relative to the screen or AUT window. The steps recorded using this mode are not editable.
This mode is typically represented in code as follows:
Window/app.RunSimulated “Track1”
This mode comes in handy when capturing a signature, for instance.
Detailed Recording mode: This mode logs the coordinates of the operation carried out in the application, regardless of whether QTP acknowledges the specific Object or Operation.
Critical points to remember about these recording modes include:
- During recording, you can momentarily switch to simulated or detailed mode, finish the necessary task, and then revert to standard recording.
- The simulated and detailed recording modes demand more memory space than the standard mode.
- Low-level recording doesn’t document mouse movements.
- The option to switch to simulated mode is only available while recording and not during editing.
- If a test documented in simulated mode is performed after altering the screen resolution, it will fail.
The menu selection to change the Recording Mode is:
Object Spy
The Object Spy is a practical feature in QTP that enables users to examine the properties and operations of an object in the AUT. The AUT must be active for this tool to be used.
The Object Spy can be accessed by selecting “Tools -> Object Spy” or by clicking on the following icon:
The Object Spy can also be accessed from the Object Repository and Object Repository Manager windows.
Upon launching, the Object Spy presents the following interface:
By utilizing the pointing hand, you can choose any object to explore its properties.
The Object Spy displays the properties as follows:
It represents all the properties and their corresponding values for the chosen object. It also illustrates the object hierarchy. Additionally, there is an “Operations” tab that lists all possible operations for the test object.
The Object Spy not only visualizes properties but also allows users to add an object to the Object Repository.
This can be accomplished by clicking on the + icon in the Object Repository.
Object Repositories
In a previous post, we detailed how an Object Repository (OR) works as a storage facility for objects.
The OR includes a list of objects that QTP learns during the recording phase, along with their particular classes. It preserves the unique identification properties (description) of objects and assigns names to the objects based on capabilities that distinguish them for easy test identification.
During recording, the objects that are interacted with are automatically included in the OR. Moreover, users can manually insert objects as required. This can be done directly from the OR window or via the Object Spy (Ctrl+R or Resources -> Object Repository or by clicking on the icon.)
There are two kinds of Object Repositories:
- Local
- Shared
By default, each action within a test has its own local repository when created. The local repository contains objects specific to that particular action.
Alternatively, users can opt to use a shared repository for multiple actions. In this situation, the shared repository is linked with the actions, enabling them to share the objects it contains. This can be accomplished using the “Object Repository Manager”.
Objects can be exported from a local repository to a shared repository to maintain a single location for all objects. Additionally, a shared repository is read-only on the action level, and all changes must be made through the “Object Repository Manager”.
The repository that an action uses must be specified in the action properties.
Practically, we will examine examples of how this is enacted in future posts.
Some critical points concerning Object repositories include:
- Regardless of using a shared repository for all actions, each action still has its own local repository by default. For instance, if Test 1 has Action 0, Action 1, and Action 2, and a shared repository named ORShared, there will be local repositories named OR0, OR1, and OR2 by default. However, if all actions employ the same shared repository, the local repositories will be empty.
- If both a local and a shared repository have an object with identical names, the action will take into account the object in its local repository.
- It is possible to associate multiple shared repositories with the same action. If Shared OR1 and Shared OR2 both feature an object named OBJ1, and the action requests OBJ1, the order of the shared repositories’ association determines which OBJ1 is used. For example, if Shared OR1 was associated first, OBJ1 from Shared OR1 will be employed.
Using a shared Object Repository is more efficient as it facilitates easy maintenance and allows the use of one object description across several actions.
In this guide, we discussed essential concepts that will assist in understanding and developing better QTP Tests. We will also address Actions, the Active Screen, and a pertinent password encoder tool before moving on to more advanced subjects.
This is guide #8 in our extensive online QTP training series comprised of 30 guides, providing comprehensive knowledge about QTP.