Print Page | Close Window

Data driven testing using excel in QTP

Printed From: One Stop Testing
Category: Testing Tools @ OneStopTesting
Forum Name: QuickTest Pro @ OneStopTesting
Forum Discription: QuickTest Pro is a fresh approach to automated software and application testing that addresses testing needs of both business analysts and Quality Assurance professionals.
URL: http://forum.onestoptesting.com/forum_posts.asp?TID=7286
Printed Date: 25Dec2024 at 11:37am


Topic: Data driven testing using excel in QTP
Posted By: Mithi25
Subject: Data driven testing using excel in QTP
Date Posted: 05Nov2009 at 1:14am
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 a=ex.Workbooks.open("D:\excel.xls")
Set b=a.worksheets("Sheet1")

dim login, pwd

for i=1 to 3

login=b.Cells(i,"A").value
pwd=b.Cells(i,"B").value
msgbox login
msgbox pwd

next

"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.
A B
1 2
3 4
5 6


-------------
http://www.quick2sms.com - Send Unlimited FREE SMS to Any Mobile Anywhere in INDIA,
Click Here



Print Page | Close Window