QTP Tutorial #18 – Data Driven and Hybrid Frameworks Explained with QTP ExamplesPosted In |Automation Testing,QTP TutorialsWe are working our way through figuring out how to derive at an automation framewor kthat works best for a certain t esting project and also are defining cert ain frameworks that already exist. The example that we were using in theprevious QTP framework articlewas creating a new Gmail account. To start with, we coded the creating of a new account scenario just by recording and play back in a linear fashion. Seeing how it lacked in mod ularity, readability and reusability we broke it down into functions that would be referenced as keywords moving forward. We did achieve modularity, readability and reusability through this method but we needed to make the program even more robust so that it can take different sets of values without having to modify the script itself. That is exactly what we are going to achieve by data driving the tests. Data Driven automation framework using QTP Creating multiple Google user accounts is the task we will try to accomplish using this framework. In the example earlier, we hard coded the fir st name, last name, user id details etc. into ourcode while trying to create an account. We will have to separate the code from the data if we have to achieve data driving aspect for this script. The data should come from a source that is not t he program itself. Typically the data input can be anything: 1.MS Excel files 2.Data base 3.Text files 4.XML files….etc.Excel files are the ones t hat get used most often. The very fact that e ach action in QTP comes integrated with a data sheet of i ts own explains why that’s so. You can use one or more data sources for a single script. The excel sheet that comes with the action can be used or you can use an external exce l sheet too. Basically a data sheet can be any relevant external file.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
7/28/2019 Tutorial #18 – Test Automation Frameworks Part-2
Examples Posted In | Automation Testing, QTP Tutorials
We are working our way through figuring out how to derive at an automation framework
that works best for a certain testing project and also are defining certain frameworks that
already exist.
The example that we were using in the previous QTP framework article was creating a new
Gmail account.
To start with, we coded the creating of a new account scenario just by recording and play back in a linear fashion. Seeing how it lacked in modularity, readability and reusability we
broke it down into functions that would be referenced as keywords moving forward.
We did achieve modularity, readability and reusability through this method but we needed to
make the program even more robust so that it can take different sets of values without having
to modify the script itself.
That is exactly what we are going to achieve by data driving the tests.
Data Driven automation framework using QTP
Creating multiple Google user accounts is the task we will try to accomplish using this
framework.
In the example earlier, we hard coded the first name, last name, user id details etc. into our
code while trying to create an account. We will have to separate the code from the data if we
have to achieve data driving aspect for this script.
The data should come from a source that is not the program itself.
Typically the data input can be anything:
1. MS Excel files
2. Data base
3. Text files
4. XML files….etc.
Excel files are the ones that get used most often. The very fact that each action in QTP comes
integrated with a data sheet of its own explains why that’s so.
You can use one or more data sources for a single script. The excel sheet that comes with the
action can be used or you can use an external excel sheet too. Basically a data sheet can beany relevant external file.
In my experience, no one framework works effectively for a certain project. Hybrid
framework is what gets used most often.
Few important points about frameworks:
1. Framework is just a solution that worked best in a certain situation but should not beconstrued as a set of rules to be definitely followed. It should be seen more like
guidelines.
2. There might be many other frameworks in use, we have only listed and explained the
common ones
3. Nomenclature – Different people address their frameworks with different names. So if
the names are slightly different from one application to another, it is normal.
4. Most of the frameworks can be used in conjunction with one another when any one of
them cannot provide an all round solution to your testing goals.
Conclusion:
For the sake of easy understanding we have reall y simpli f ied the concepts of fr amework
here. I f you have any f ramework related issues that you are facing that i s not covered in
these articles, do let us know. We wil l most defini tely try to answer your questions. Please