Step 1: Assess the Application
Before all great automation efforts, comes planning. As an Automation Specialist, you should consider yourself as a developer for the QA team. You are provided a set of requirements and you must develop automated scripts based on these requirements. To comprehend these requirements, you will be using your knowledge of the application to construct feasible solutions to burdensome tasks.
Therefore, you absolutely must begin with analyzing the application. The knowledge and understanding that you gain here will determine your outcome of the automation scripts. We have seen countless hours lost to automation efforts because the Automation Engineer did not initially understand the application.
Don’t be one of these burdens for your company. Consider the following information when assessing the application:
- Are there separate areas for certain activities?
- What are these activities?
- What are the expected outcomes of these activities?
- How do you validate these activities?
- How many screens need to be tested?
- How many objects need to be tested?
- Are the same activities repeated over and over?
- Is the user always logging in and logging out? Is the user always performing a certain set of actions to get to a different stage of the application?
- This will allow you to create smaller units of code that will significantly decrease your maintenance time.
- Will you be doing cross-browser testing?
If you are working with a web application, then most likely you will be, unless strictly told not to by your management. It is highly recommended to cross-browser test because one well- designed script can be run on multiple browsers, providing great coverage for the QA team.
- Will you be testing on multiple development environments?
I can almost guarantee that you will be! So plan ahead. Be sure that you are not hardcoding urls of you applications. Store all variables in external locations such as .xml or .json files for easy configuration changes.
Another critical step of the process is making sure that your entire testing infrastructure is in place. You cannot predict everything that you will need in advance. But, a lot of problems can be avoided with proper planning and care.
- Object Repositories
- Environmental Variable files
- Function Libraries
- Create scripts to automatically configure your QTP settings.
- Create recovery scenarios.
- Run session specific preferences.
- Install any patches that you may need for QTP to work correctly.
This is such an important step, yet we have run into so many Automation Engineers who have no idea how to configure their QTP to even make it work. It’s sad, don’t be one of those people.
Here is a series of videos to help you understand why QTP/UFT may not be recognizing objects:
If you are working on a web application, don’t forget that all browsers are not created equal. Each browser needs a special approach to be handled. Also, make sure to turn off tabbed browsing. This is the basics of QTP Automation Testing
Yes, even different computers can affect how your script runs. Some may have Admin Rights, others may not. Maybe you need to allow other users to have the capability to remote into an automation machine. These are all questions that need to be asked.
Ideal situations include 1 vm that can run multiple processes and run all of your automated checks in the cloud. That way someone else maintains all the infrastructure and you get all of the benefits. 🙂
There are many ways to design your test. But, you need to plan the most logical and efficient manner. Proceed through the application manually, step by step, and write down the process. Once the process is written, just transform it into code! Careful planning here will provide you with an efficient and easy to maintain script and framework.
Develop small functions that perform basic tasks.
These functions should be as reusable as possible to avoid needing future development of functions. This is the approach that we recommend and we believe to be most indicative of a skilled Automation Engineer. Some common examples of functions include getting some value, setting some value, login, logout.
Do NOT use separate reusable actions to create a test.
This is similar to the creation of functions approach, but it has several disadvantages. It is much harder to have a reusable action and constantly link to it whenever you need it, because it’s an entire test script. If you need to use a logout action in 200 scripts, it’s a painful process to constantly link to this separate action. Furthermore, each action needs to be configured to Output and Input parameters so that the actions are dynamic. It is much faster and simpler to just transform your action and keep it in a global function library.
Some individuals believe that you should run your test only after it is fully scripted. We believe that this methodology is incorrect and outdated. A well-known development practice is called Unit Testing; where the developer creates a small module of code and then tests it for the functionality. To be the most effective Automation Engineer, we believe this method to be the best. Let’s face it; you are technically a developer, so follow development best practices. Therefore, you should alternate between scripting a small unit of code and then test it for functionality. For example, create a small unit that opens an Excel sheet and validates the version of the template. Test this unit. If it is successful in achieving its goal, move on to the next functionality.
Debugging and Analyzing, although the last step in the sequence of events, this does not mean that it is the least important. In fact, an Automation Specialist who does not know how to debug is one whom we would never think about hiring for our projects. We have seen individuals who have absolutely no concept of debugging and others who believe that well-placed Message Boxes are a way to debug. These stories are sad, but it is the reality of some Automation Engineers in the world. Therefore, learn proper debugging to stay ahead of these charlatans. QTP offers many features for debugging.
- Use Step Into, Step Over and so on to traverse code line by line.
- Use breakpoints to stop at a certain location in the script and analyze for possible errors.
- Use the Debug Viewer to analyze objects, variables, and conditional logic.
- Perform this as you are scripting your test to make sure that all of your logic is properly coded.
Here are some excellent resources on how to debug:
- How to use the UFT Console Pane and Data Table
- How to user the Console Pane in UFT
- More debugging features of UFT
- Processing arrays and viewing results in the Watch Tab
- Navigating through a Dictionary and learning to follow variable values
QTP, HP. (n.d.). HP QuickTest Professional Software Version: 11.
Latest posts by Nikolay Advolodkin (see all)
- Best Online Resources to Learn Automation Testing - December 22, 2016
- Parallel Test Execution Using Selenium Webdriver - April 26, 2016
- Proper Black Box Test Case Design-part 2-Boundary Value Analysis - April 5, 2016