Data driven testing using excel in QTP

This is script for data driven using excel sheet.
In this script we are not importing excel sheet to datatable. Directly values are supplied to application from excel sheet.

set ex= CreateObject("Excel.Application")
Set b=a.worksheets("Sheet1")

dim login, pwd

for i=1 to 3

msgbox login
msgbox pwd


"D:\excel.xls" is path of excel sheet.
"sheet1" indicates sheet name in which values are present.
A,B are column names in excel sheet.

we have excel sheet with values as shown below in d drive.
1 2
3 4
5 6

1 comment:

Alex said...

For me excel files are very important, because of I work with theirs on my job. One day I ran into like problem. Luckily for me one program relieved me for a minute and convinced of its abilities for solving out all troubles in this sphere - recover Excel file tools.