Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Retrieving test data from Excel sheet
#5
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi,

As tarun suggested, use .xls format file instead .xlsx format excel files as they are not supported by QTP.

Code:
Dim xl
Set xl=CreateObject("Excel.Application")
xl.WorkBooks.Open "your excel file path"
xl.Sheets("Sheetname").Select
UserId=xl.Cells(1,1).value
FirstName =xl.Cells(1,2).value
LastName=xl.Cells(1,3).value

Browser("...").Page("...").WebEdit("UserId").Set UserId
Browser("...").Page("...").WebEdit("FirstName ").Set FirstName
Browser("...").Page("...").WebEdit("LastName").Set LastName

xl.ActiveWorkBook.Save
xl.Application.Quit
Set xl=nothing
Reply


Messages In This Thread
RE: Retrieving test data from Excel sheet - by sreekanth chilam - 01-27-2011, 10:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple rows of test data Bhuvana 0 1,358 01-03-2020, 09:30 PM
Last Post: Bhuvana
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,355 07-10-2017, 04:20 PM
Last Post: rajeevk7
  dtLocalSheet empty even though excel file contains data cantorre 2 2,451 05-10-2017, 12:47 PM
Last Post: vidhi
  Reading data from excel sheet serenediva 1 9,696 03-03-2017, 10:07 AM
Last Post: vinod123
Question QTP not performing iterations based on local data sheet Breaker 18 56,959 01-25-2016, 04:32 PM
Last Post: arunshuklainbox

Forum Jump:


Users browsing this thread: 8 Guest(s)