Sunday, June 15, 2008

QTP Tutorials 2 - Using Data Table

Lets use data table:

There are two types of data tables Design time and Run time:

Design time data table is what you see in the main QTP window and run time data table you can see only in the test results window. Design time data table is always created before running the test while run time data table is generated after execution of the test.

1) Open new test (Ctrl+N)

2) We will click on record toolbar button ( or Automation menu --> record or press F3). when we click on record, "Record and Run Settings" window opens up. Go to "Windows Applications" tab and choose first option "Record and run test on any open windows based application." and click on ok.

3) Open Flight application (Start-->All programs-->QuickTest Professional->Sample Applications-->Flight)

4) Type Agent name as "Niyati" (you can enter any, but must be 4 characters or more) and enter password as "mercury".

5) In the flight reservation window that opens up:

6) Click on File-->exit. Click Stop to stop the recording.

7) In the keyword view you will see four headings- Item, Operation, Value, Documentation. Under Value click on Kumar and on the right hand side of Kumar you will see a small icon, just click on that (or press ctrl + F11), The "Value Configuration Options" dialog box opens. In that dialog box click on parameter radio button and select Data Table from there. In Name field enter any variable name (I entered 'username'). Let all other be the default options in this dialog box and click on ok.

8) QTP will add username column in the data table (bottom, left hand side) with 'Niyati' as the first value.

9) Now enter more values in the username column, manually. I entered 'Varun' and 'Tanya' in 2nd and 3rd column respectively.

10) Save the test. (File-->Save).

11) Now run the test. (follow same steps as we did earlier).

12) If the test ran successfully, in the Results summary window on the left hand side you will see three iterations (because we added 3 variables in the 3 rows of a data table). Expand 1st iteration, it will show action summary for that iteration, expand the action summary, it will show Login, Expand the login. Click on the first option under it "Agent Name: SetText". On the right hand side it will show 1st variable name under details.

13) Similarly you can look for 2nd and 3rd.


Anonymous said...

Thank U, U have done a great job yaar.......

quicky said...

Thank you. This is very helpful for the beginners. You are doing a great Job.

quicky said...

This is so helpful for the begineers.U are doing a great job.

quicky said...

This is so helpful for the beginners. You are doing a great job. Thanks.

Anonymous said...

Thank you for your effort. Found your site few days ago. Using your examples to practice what I learned before. I am looking for exposure to recovery scenario, Object repository, descriptive programming examples among other things.

Ruchi said...

Actually I was starting up with QTP and found your tutorial really helpful.

I am looking more on the scripting side

Ruchi said...

thanks !!!
I found your tutorial really helpful as I was starting up with QTP.

Looking more on the scripting side

Vijayendra said...

great job...thanks a lot indeed:)

Anonymous said...

Thanks a lot
I googled a lot but this is the only one which is really nice tutorial for beginners

God bless u