what is the procedure to create scripts using Data Driven Testing in QTP?

Posted on 2008-09-30
Medium Priority
Last Modified: 2012-06-27
The only thing i know about the Data Driven Frame work in QTP is as follows:
In data driven framework, we will take input from one input excel file, and process the input in the script and send the result to the same excel file. In this framework, we can take the data through excel
file, .csv file, ADO, DAO(Data Access Objects).....ADO means ActiveX Data Objects. This is the current and latest method of retrieving the information from the databases.

Can anyone please guide me or provide some detailed descripton material where i can learn to create scripts using Data Driven Framework.
Question by:agcps
  • 3
  • 2
LVL 16

Expert Comment

by:Bryan Butler
ID: 22614152
I'm not sure how general or specific to be here.  If you are 1-new to programming, or 2-just new to rec/play/script testing, or if 3-you are just new to this tool as you mention.  I'll assume 3, and to what degree, I'll go with you know some things about programming and also how rec/play/script testing is done in general.  So, to start with, you will benefit greatly to use the rec play part initially to start scripting.  Here you would record some "test" actions and then use the syntax in the scripts to write the real scripts.  Initally playing around with variable substitution using spreadsheet will be the best way to learn. Also in the beginning you will be getting used to the various "objects" and naming conventions and controls sturctures (loops, data types, arrays, etc).  Then you start learning the shortcuts and workarounds to handle all the buttons/input/operations that your program does; you will be lucky if QTP is able to recognize every one of the actions your tests need to do.  Also, you will start to see patterns in the procedures and algorythms you use for simple tests, which is where I would start - doing simple tests.  That gives you the time to learn how to use the tool best for your app, and see more patterns and be better able to design the tests.  Then you can start to design the framework using all the current tricks, tips and tools you have.  I suggest the 2 level spreadsheet framework.  I forget the details for this, but I can find them if you'd like.  Basically you use one "parent" for the tests and results, and then individual "children" for test scripts.  I know this isn't about using spreadsheets, but I'm hoping it's what you were looking for, or at least helps a bit.  Cheers.

Author Comment

ID: 22648257
I have worked with QTP for an Year.
I have automated Smoke Test.
I know how to use Object repository, Global - Local Data sheets, Doing VB scripting to some extent.

I want to learn how this Data Driven testing is done in QTP.

LVL 16

Expert Comment

by:Bryan Butler
ID: 22672886
I cant' give you the details right now as it's been a while since I used it.  I just remember you have variable names for the spreadsheet values that you use in the scripts, and also associate the test scripts with the spreadsheet.  I'll see if I can dig up some of my old work and get specific.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Accepted Solution

Suveer Patil earned 2000 total points
ID: 22936172
In QTP Data Driven wizard is available in

Tool->Data Driven Wizard

When no script is recorded "Data driven wizard " is disable. Purpose of Data Driven testing is parameterize our test so we can
repetitively perform our test.

We can parameterize our test in both views (i) Keyword (ii) expert

In keyword view only
Select the field you want paqrameterize,
(II) Right click on it ,select parameter in place of "constant"
Select data-table and then global test sheet
(IV) Give column name in "Data Table" by pressing "modify"

That will create column into
your data-table and as many valid value you will give it will perform test.

From expert view -

(I) Select Tool->Data Driver wizard
(II) In this all the fields will be shown to you
(III) Select "parameterize" button
(IV) Select "step -by-step" and press next
(V) It will show all the field select the field you want to parameterize and create column in "Data Table"
(VI) Select data-table and then global test sheet
(VII) Give column name in "Data Table" by pressing "modify"

It will create data driven test

LVL 16

Expert Comment

by:Bryan Butler
ID: 23207826
Excellent Suveer.  Does that work agcps?

Expert Comment

by:Suveer Patil
ID: 24793171
Data Driven Testing in QTP

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction I've been in the software industry for over 20 years. I've interviewed at lots of companies, from start ups in stealth mode to some of the biggest and most successful. I've also conducted lots of interviews, especially as I've become a…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In the video, one can understand the process of resizing images in single or bulk. Kernel Bulk Image Resizer is an easy to use tool for resizing large number of images. One can add and resize multiple images with this tool in single go. The video sh…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question