Various Methodologies of Test Creation in QTP
While using QTP, we can create tests with the help of three types of methodologies like:
1) Keyword-driven methodology
2) Step recording
3) Combination of both Keyword-driven methodology & Recording.
Keyword-driven methodology:
Creation of tests with the help of keyword-driven methodology requires an infrastructure for various required resources. Resources are such as shared object repositories, function libraries, and recovery scenarios. For setting up the infrastructure we require thorough knowledge of the application and a great level of expertise of QTP software.
This methodology enables us to create tests at a more application-specific level and with a more structured design. This enables us to maintain our tests more efficiently and provides us with more flexibility as compared to a recorded test.
Step recording:
In step recording methodology, QTP generates test steps by recording all the processes performed by us on the application. As we navigate through the application, QTP graphically displays each step we perform as a row in the Keyword View. We define a step by anything a user does to cause a change in the content of a page or object in the application, for example, clicking a link or typing data into an edit box is a step.Recording methodology is found easier by new QTP users or when beginning to design the tests for a new application or a new feature.
Advantages of Keyword-Driven testing:
1) This methodology enables us to design the tests at a business level rather than at the object level. For example, QTP may recognize a single option selection in our application as several steps: a click on a button object, a mouse operation on a list object, and then a keyboard operation on a list sub-item. We can create an appropriately-named function to represent all of these lower-level operations in a single, business-level keyword.
2) By incorporating technical operations, like synchronization statement which waits for client-server communications to finish, into higher level keywords, tests are easier to read and easier to maintain.
3) This methodology leads to a more efficient separation between resource maintenance and test maintenance. This enables the automation experts to focus on maintaining objects and functions while application testers focus on maintaining the test structure and design.
4) While recording the tests, we may not notice that new objects are being added to the local object repository. This may result in maintaining local object repositories with copies of the same objects in many cases. When using this methodology, we select the objects for our steps from the existing object repository. When we need a new object, we can add it to our local object repository temporarily, but we are also aware that we need to add it to the shared object repository for future use.
5) While recording the tests, QTP enters the correct objects, methods, and argument values for us. Hence, it is possible to create a test with little preparation or planning. Although this makes it easier to create tests quickly, such tests are harder to maintain when the application changes and often require re-recording large parts of the test.
With this methodology, we select from existing objects and operation keywords. Hence, we need to be familiar with both the object repositories and the function libraries that are available. We need to have a good idea of what we want our test to look like before we begin inserting steps. This usually results in well-planned and better-structured tests, which also results in easier long-term maintenance.
6) Automation experts can add objects and functions based on detailed product specifications even before a feature has been added to a product. With help of keyword-driven testing, we can begin to develop tests for a new product or feature earlier in the development cycle.
Advantages of Step Recording:
1) Recording methodology is helpful for beginner. It helps the learner to understand how QTP interprets the operations we perform on the application, and how it converts them to QTP objects and built-in operations.
2) Recording methodology is useful for experienced users of QTP as well, especially when they work with some new application or some new features of an existing application. Recording is also helpful while developing functions, which incorporate built-in QTP keywords.
3) Recording methodology is useful when we need to quickly create a test for testing the basic functionality of an application, but we do not require long-term maintenance.
Many More Articles on HP QuickTest Professional
An expert on R&D, Online Training and Publishing. He is M.Tech. (Honours) and is a part of the STG team since inception.