In this post, we are going to discuss about Automation Framework! I'm not going to write any bookish definitions here. It's all what I learned from practical experience.
Okey!
First thing first...
What is framework?
Do you watch movies in Cinema Hall? I know you do!!
Take a moment and think about what happens starting from the
point you enter in Cinema Hall to the point you come out. Here are few typical
steps..
- You enter in hall >> go the ticket window >>
pick a movie broacher somewhere nearby ticket window
- Choose a particular movie you wanna watch (decision
influenced by the choice of wife/girlfriend!!)
- Come in the queue and wait for your turn, pay by card and
get the ticket.
- On ticket you find some very important information i.e.
show start time, Audi No. (Hall No.) etc.
- You go into the given sign-posted Audi, 5-10 minutes
earlier then show time, watch the movie (along with other activities ;) ......
and so on....
Everything is planned.. In order!! Isn’t it? This is nothing but a framework..
Automation Framework is a set of guidelines and process you
use to manage and optimize your automation testing.
In simple words, Framework
is a way to do the things in fashioned and organized manner! Framework is
nothing but a concept.
Why I need a Framework?:
Now assume that Cinema Hall doesn’t follow any framework.
- You enter in Cinema Hall, go the ticket window, - but there is no
movie broacher nearby ticket window??
- You go to the ticket window, but they don’t accept
credit/debit cards?? (and you don't carry cash..)
- Okay! You somehow managed to buy ticket, but ticket doesn’t
tell you show time and Audi/Hall No.??
- You reached into the Audi but movie has not been started on
time??
Would you like to go again in this Cinema Hall?? I'm sure
not..
It's always possible to work without framework but you'll be
doing a lot of rework, everything will be here & there and in most of the
time you will end-up with a mess, especially in the large projects.
Framework lets you predefine your automation plans,
strategies and how you are going to proceed.
Types of Framework:
Framework can be of several types, but here are three main types of frameworks-
1. Keyword driven framework
2. Data driven framework
3. Hybrid framework
But this is only theoretical. Practically, there is no 'Chinese Wall' between the framework types.
In every organization you work, you'll find that it's quite different from the other and not only on organization level, you can feel the difference within different projects!
Yess, but most of the them could be mapped with Hybrid type and I like it!! :)
Hybrid framework has no boundaries and open to take benefit of all possible type of frameworks.
How to design a framework?
I have done a lot of automation projects and designed a lot a frameworks, but seriously guys, I never used any particular type of framework!
Practically, every application/project has its own expectation. You just need to start your work in organized way and believe me friends, at the end of the day; your framework will be ready automatically!! Sounds crazy??
You can't design a complete framework and then start automation! You start automation and framework will start building simultaneously.
The first step of any test automation framework is to do a quick POC with few high priority test cases aka 'smoke tests'. By doing POC, you will identify the object identification issues, challenges, complexities, required test-data and limitation you have. Once you are ready with this information, you can proceed with next steps. On the basis of above information, you can decide what type of framework is most suitable to you.
But before starting, you must take some time to decide your strategies about..
The first step of any test automation framework is to do a quick POC with few high priority test cases aka 'smoke tests'. By doing POC, you will identify the object identification issues, challenges, complexities, required test-data and limitation you have. Once you are ready with this information, you can proceed with next steps. On the basis of above information, you can decide what type of framework is most suitable to you.
But before starting, you must take some time to decide your strategies about..
1. Object Identification
2. Test-Data
3. Function Library
4. Error Handling
5. Controller/Driver script
2. Test-Data
3. Function Library
4. Error Handling
5. Controller/Driver script
6. Documents and Manuals
7. Test Reults
7. Test Reults
1. Object Identification:
One of the most important aspect of QTP automation is - How to identify objects i.e. using Object Repository(OR) or Descriptive programming(DP) or both. As per my understanding, dont't try to stick on one particular. Depending on the application/object types, mixed approach is most fruitful most of the time.
Although both OR and DP have their own pros n cons, but remember, you get full benefit of QTP only when you use OR like debugging, chechpoints etc. So make sure how to identify objects.
Many claim that DP should be used for whole project without using any OR approach, but I disagree. DP is nice thing to use but should be used only when required like if your application is having dynamic objects etc. Doing whole automation using DP without any solid reason is not sensible (personal opinion!).
Although both OR and DP have their own pros n cons, but remember, you get full benefit of QTP only when you use OR like debugging, chechpoints etc. So make sure how to identify objects.
Many claim that DP should be used for whole project without using any OR approach, but I disagree. DP is nice thing to use but should be used only when required like if your application is having dynamic objects etc. Doing whole automation using DP without any solid reason is not sensible (personal opinion!).
2. Test-Data:
How to manage you data? DataTable or Excel or may be flat/csv files.
3. Function Library:
Function library could be QTP specific (.qfl) or external (i.e. .vbs). Be clear about what type of function libraries you are going to use and why.
4. Error Handling:
What's your plan for handling errors? Be clear about it. Are you going to use QTP's Recovery Scenarios or you will be writing your own .vbs functions?
5. Controller script:
Design a controller script, which will control all your automation. It should be neat. This helps to understand what actually you are going to call.
6. Documents and Manuals:
Keep all the documentation, user guide/manuals, keywords descriptions here.
7. Test Results:
Result is probably most important part of the framework. Put extra attention to results.. always!!
Why? Because result is the face of your framework! This is what you show to world. If your result is fantastic, nobody bothers what type of framework you use, what the hell you have written in your functions!! :) But if results are not flashy.. then.. you know!!
So never underestimate the importance of the results. It must be very well presented.
Create different folder for the these seven things and keep data in folders accordingly.
This was the one part.
Result is probably most important part of the framework. Put extra attention to results.. always!!
Why? Because result is the face of your framework! This is what you show to world. If your result is fantastic, nobody bothers what type of framework you use, what the hell you have written in your functions!! :) But if results are not flashy.. then.. you know!!
So never underestimate the importance of the results. It must be very well presented.
Create different folder for the these seven things and keep data in folders accordingly.
This was the one part.
Apart from this, from first day of your automation, keep only one thing in your mind.. follow general good practices!
Here are few points need to be take care in designing successful framework.
- Try to document each and every thing, as much as you can! like comments in script, modification etc.
- Don't stick with any particular object identification, use mix of OR and DP
- While using OR, don't use record and playback, just add object in the object repository and code the script manually.
- Follow proper Naming-Conventions for all your variables, functions, files.
- Define all the variables in you scripts, use Option Explicit.
- Try to keep you functions small to enhance reusability and portability.
- Never hard code any data in the scripts, use parametrization.
- Take regular back-up of your work.
Good one and worth... Thanks for sharing your expertise
ReplyDeleteThanks for your valuable comments over framework.
DeleteGreat Article
DeleteProjects for ECE Final Year Students Final Year Project Centers in Chennai
It is very nice. thanks a lot for this information. could you please elabotate about controller script.
ReplyDeleteThanks
Grt...!
ReplyDeleteVery much realistic information.
Thanks..
Thanks for sharing information.
ReplyDeletevery nice and well structured.. thanks..
ReplyDeleteHi
ReplyDeleteI would like have some sample code for keyword driven framework.
hey..can u pls explain POC?
ReplyDeleteProof Of Concept(POC)
DeleteProof of Concept
ReplyDeleteWhat Exactly is this ? Can u please elaborate it ??
DeleteThis is just like premium show, we just create some automation scripts for that application to check whether this is suitable for automation, if so we will expose to that client saying that we can automate this application. once that is approved by client he will sign for start of automation in detailed
DeleteVery nice and well structered... will you pls explain more clear for "Controller Script".
ReplyDeleteThanks, Prasad
Its really useful and it is practical also .
ReplyDeleteThanks for posting.
The Concepts are short and Very Effective ,
ReplyDeleteThanks for Posting such a useful information...
Thank You
Vilas Rajeshware
Can you please tell what percentage of bugs are generally found using QTP? Is it more/less than Manual testing? Also, what kind of bugs are usually detected using automation?
ReplyDeleteit is really very useful .thanks for posting
ReplyDeleteThis is the first blog where i have commented till now. Excellent article "How to design Automation Frameworks in QTP". It is appearing as realistic
ReplyDeletejust tell me i want to prepare frame fork how can i prepare framework.........., plz give me reply
ReplyDeleteNice one...
ReplyDeletehey!! thanks a lot :) :) i understood the real concept of automation framework after reading your article !!:)
ReplyDeleteI really like it. its so clear & easy to understand. Thanks Again.
ReplyDeleteVery Useful even for Beginners also. Thanks a lot...
ReplyDeleteThanks for sharing information,its really great support for us.
ReplyDeletevery useful...
ReplyDeleteThis is the first blog where i have commented till now. Excellent article "How to design Automation Frameworks in QTP". It is appearing as realistic
ReplyDeleteNice and clear with useful information
ReplyDeleteI searched many sites for automation definition and not found useful one. I got clear idea after visiting ur site. thanks a lot. very useful info.
ReplyDeleteThank you for this real effective information.
ReplyDeleteThanks a lot to all of you for your comments.
ReplyDeleteReally nice...thank you
ReplyDeleteVery good info, Can you please little bit eloborate with examples of script, folder etc...
ReplyDeleteThis is really Nice
ReplyDeleteCan you explain the frame work structure/folder?
ReplyDeletetell me some sites from where I can download Qtp 10 and 11 on windows xp service pack 2 and 3 on 32 and 64 bit machine
ReplyDeleteThank you very much to all of you. I'm glad you liked my posts.
ReplyDeleteThanks...it cleared me that framework is just aconcept...thanks it was useful
ReplyDeleteNice one.., Thanks for sharing your expertise.. :)
ReplyDeleteCan you please share sample framework?
It will more helpful for us..
Advance Thanks.. :)
thanks for info...
ReplyDeletethnx for good info, itz very useful
ReplyDeleteCan u plz show the framework using excel and notepad instead of QTP
ReplyDeleteThanks
Tareq
@divya chum
ReplyDeleteThank you very much. I'm glad you find it useful.
@Tariqul Islam
ReplyDeleteI didn't get your query, without QTP? Do you mean Keyword Driven Framework?
Really Helpful. Thank you very much for giving valuable inputs.
ReplyDeleteI am sick of reading same old answers, definitions every where. Thanks for being so clear. Everybody else just copies and paste in other websites. I hate it so much. Website is full of junk
ReplyDeletethank you very much you all!!
ReplyDeleteVery Nice:)
ReplyDeleteCan you please tell more about the controller script?
ReplyDeleteGreat...good real time knowledge ...Thanks!!
ReplyDeleteGreat information http://www.couponslake.com/
ReplyDeleteGood Article for QTP Framework
ReplyDeleteReally Helpful. Thank you very much for giving valuable inputs.
ReplyDeleteReply
Thanks!
ReplyDeleteits realistic, even dummies can easily understand.it will be more useful if u explain with examples or by giving an example.
ReplyDeletethanks to the blogger.
i understood what actually framework is...thanks a lot for the blog.. :)
ReplyDeleteThanks
DeleteThis comment has been removed by the author.
ReplyDeletesuperb i have understood very well but can u provide any examples from next time onwards.....
DeleteHey Abhikansh, Thanks Dude.....Its very useful. The content on your blog is very good with the real life examples. I learned a lot over here. I will be following your blog in future.
ReplyDeleteThanks a lot,
Pradeep Kumar
@Pradeep
ReplyDeleteThanks. I am glad you like it :)
Thank you!!
ReplyDeleteHey Hi...dis blog is useful n worth reading. Can u plz elaborate on controller script
ReplyDeleteThank You:)
Very clearly written, thanks very much.
ReplyDeleteAwesome..... Hats off :)
ReplyDeleteits very clear and useful information.Can u tel me how to do keyword driven and data driven frameworks?
ReplyDeleteIT IS VERY USEFUL THANKS...
ReplyDeleteIts wonderful and helped me to understand the framework concepts
ReplyDeletevery usefull to who is gng to start automation Nice...
ReplyDeletethnx,
@Venkateswarlu Gottipati - thank you very much!
ReplyDeleteHi I have read all your topics. all the topics are clearly explained with simple examples. it was very useful.... thx..... jayashree
ReplyDeleteHi its very easy to understand... thanks...
ReplyDeleteGreat piece of information. Keep posting more such post on framework design
ReplyDeletehi Abhikansh Jain, your spooning explanation is excellent...your filling lot of energy in to users,thanks alot...please can u reply this..i have strong knowledge on QTP, i am able to write any test script for any complex scenario,BUT using Linear approach only..... but i am struggling to write Framework based test script.. please reply me, difference between linear script and Frame work based script.
ReplyDeletereal time we are following framework based script...recently i saw one script in MNC...that is totally confusing and i didnt understd that script..pls suggest me how can i learn real time script..
i have 100 % knowledge on Linear manner , may i eligible for Companies, thank u
waiting for ur favorable reply
very easy to understan any people...thanks bro...
ReplyDeleteNice article providing quick understanding of the Framework concept. Also, easily understandable. The tips too are quite helpful. Thanks Abhikansh.
ReplyDeleteThanks a lot to all of you.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete@Dinesh Sorry for replying too late! I don't think there is any specific manner called linear. Do you mean recording? or writing script without using function library or DP? If so, yeah, for complex real time projects, above way of writing script will not yield any fruitful results. To get most out of your automation effort, we should always use proper framework. And as I always say.. "framework is nothing but concept"! Its just doing the things in structured way :) So if you can automate any application without using a framework, you are more then capable of using framework as well. :)
ReplyDeleteVery nice explanation thanks a lot
ReplyDeleteGreat Knowledge you got in making people understand in a v easy and simple way.
ReplyDeletegrt
ReplyDeletecan any one tell How to getPDFtext & stroe in variable
ReplyDeleteReally very help-ful for New And as well as Automation Testers, Indeed its Nice Explnation ................
ReplyDeleteNice information
ReplyDeleteThank you very much for your Fabulous Explanation.
ReplyDeleteVery useful, thx for the good information
ReplyDeleteHello
ReplyDeleteI am an experience QTP user. I am impressed by your knowledge and willingness to share it with the world.
Keep up the good work.
regards
nimith
nice informatioon
ReplyDeletehi Abhikansh Jain
ReplyDeleteyour information and explanation is awesome dude. its really shattered some of my doubts on framework
ReplyDeleteAbhikansh Jain, my friend went for interview on qtp(3 years fake exp) and he was asked,in your company what is the flow you are using for automating the project.(i am also searching the job with 3 years f e).like how do you work on your project.
ReplyDeleteany one explain me keyword driven frame work mainly interview point of view
ReplyDeleteGood starting point. Thanks
ReplyDeleteBeautifully explained ..Must visit for beginners
ReplyDeleteReally awesome blog. Your blog is really useful for beginners
ReplyDeleteSoftware Testing Training in Chennai | Selenium Training in Chennai | Load Runner Training in Chennai | JMeter Training in Chennai
Nice information about the automation frameworks My sincere Thanks for sharing this post
ReplyDeleteSoftware Testing Training in Chennai
really have a wonderful post.Thanks for sharing.keep sharing more blogs.Anybody want to learn
ReplyDeleteSelenium Training in Bangalore
Thanks for sharing this QTP informative blog. Expecting more Blog Post Best QTP training institute in Bangalore.
ReplyDeleteVery good informative article. Thanks for sharing such nice article, keep on up dating such good articles.
ReplyDeleteAustere Technologies | Best Cloud Solution services
IT'S REALLY GOOD INFORMATIVE POST ABOUT QPT. THANKS FOR SHARING.
ReplyDeleteNO.1 IOT SERVICES | Internet Of Things
REALLY VERY EXCELLENT INFORMATION. I AM VERY GLAD TO SEE YOUR BLOG FOR THIS INFORMATION. THANKS FOR SHARING. KEEP UPDATING.
ReplyDeleteNO.1 APP DEVELOPMENT SERVICES | MASSIL TECHNOLOGIES
Excellent information, Keep sharing.
ReplyDeleteBest IT Security Services | Austere Technologies
I strongly believe that there will be good opportunities for those who looked at your site...
ReplyDeleteBest Online Software Training Institute | Automation Anywhere Training
Nice blog with excellent information. Thank you, keep sharing.
ReplyDeleteChoose Avinash College Of Commerce for Best career in commerce
Really excellent information you made, very helpful. Thank you.
ReplyDeleteSoftware Testing Services | Austere Technology
Wow...What an excellent informative blog, really helpful. Thank you.
ReplyDeletechartered accountant | Avinash college of commerce
Nice blog with excellent information. Thank you, keep sharing.
ReplyDeletechartered accountant course in Hyderabad | Avinash college of commerce
This is a really great informative blog. Keep Sharing.
ReplyDeleteBest Degree Colleges Hyderabad | Avinash College of Commerce
Hi Thanks for the nice information its very useful to read your blog. We provide best Block Chain Services
ReplyDeleteThank you for sharing this valuable information. But get out of this busy life and find some peace with a beautiful trip book best Andaman honeymoon packages
ReplyDeleteThank you for sharing this valuable information. But get out this busy life and find some peace with a beautiful trip. book ANDAMAN HOLIDAY PACKAGES @ 35999
ReplyDeleteThank you for sharing this valuable information. But get out this busy life and find some peace with a beautiful trip. book CHEAP ANDAMAN PACKAGES @9999
ReplyDeleteGood information.
ReplyDeleteB.com Integrated Courses | Avinash College of commerce
Hi Thanks for the nice information its very useful to read your blog. We provide About Best Software Development Services
ReplyDeleteHi Thanks for the nice information its very useful to read your blog. We provide best Find All Isfs Courses
ReplyDeleteBest informative blog. Thank you.
ReplyDeletecima courses in hyderabad | ISFS
Excellent informative blog, keep for sharing.
ReplyDeleteBest System Integration services | Massil Technologies
QTP training in bangalore,QTP training in Bangalore offered by Training in Bangalore with 100% placement assistance. Best QTP training in Bangalore with certified experts
ReplyDeleteqtp training in bangalore
IOT Training in Bangalore - Live Online & ClassroomStudents are made to understand the type of input devices and communications among the devices in a wireless media.IOT Training course observes iot as the platform for networking of different devices on the internet and their inter related communication.
ReplyDeleteThis blog through it words has provided a key to literacy.
ReplyDeletehttps://www.startupmag.it/etichettatrice-professionale/
This comment has been removed by the author.
ReplyDeleteThanks for the nice information and also it's very inspirational and Thanks for the detailed explanation. Really useful. Keep sharing more. Regards. Click Here for Commerce College in Hyderabad
ReplyDeletenice post.
ReplyDelete"best andaman honeymoon packages
andaman honeymoon tour packages "
Please refer below if you are looking for Online Job Support and Proxy support from India
ReplyDeleteHadoop Online Job Support and Proxy support from India | Informatica Online Job Support and Proxy Support From India | PHP Online Job Support and Proxy Support From India | DevOps Online Job Support from India | Selenium Online Job Support and Proxy Support from India| Manual Testing Online Job Support and Proxy Support From India | DotNet Online Job Support and Proxy Support from India
Thank you for excellent article.
i discovered this weblog after a long time that's clearly beneficial to allow understand unique techniques. i'm going to adopt the ones new issue to my career and thankful for this assist. Design of electrical drives
ReplyDeleteYes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks Seo Services Singapore
ReplyDeleteWow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also Seo Services Singapore
ReplyDeleteThis blog is so stunningly outstanding. Left its readers in the awe.Automation testing
ReplyDeleteThis blog through it words has provided a key to literacy.alpinestars boots
ReplyDeleteIf you too are blessed with good programming knowledge or analytical skills and want your knowledge to be used to the best and wish to stand out against the competition, get yourself enrolled to The Best Institute machine learning course in hyderabad
ReplyDelete