Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


I am using excel sheet to export data to QTP but it
selects just one row of data from excel sheel how to import
all rows of excel sheet to QTP during runtime

Answers were Sorted based on User's Feedback



I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel ..

Answer / uday kumar_anem

Here i am sharing a small snippet script, to import the
data from Excel sheet to QTP during runtime and using the
values.

I have an Excel sheet which contains OrderNumber column and
its values. After that i am displaying the order numbers in
excel during runtime.

datatable.Import("E:\Programming Samples\QTP
Samples\OrderNumbers.xls")
datatable.GetSheet(1)
rowCount=datatable.GetRowCount
For i=1 to rowCount
datatable.SetCurrentRow(i)
val=datatable.Value("OrderNumber","Global")
msgbox(val)
Next

Is This Answer Correct ?    19 Yes 2 No

I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel ..

Answer / yusuf

The problem is not about import it is about EXPORT. I have
the same problem;
I add a new sheet to datatable and add new parameters then I
try to go and set second rows values but I can't go second
row. So I could EXPORT only one row from datatable.

Is there any suggestion about this problem?

Thanks.

Is This Answer Correct ?    7 Yes 1 No

I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel ..

Answer / hatim

Hi,
instead of reinventing the wheel try the QTP import method

like this

DataTable.ImportSheet "C:\name.xls" ,"srcSheetname or index
" ,"type your dist data table sheet name here"

Is This Answer Correct ?    6 Yes 1 No

I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel ..

Answer / ramu

by using the method of

dataTable.importsheet(filename,sheetsource,sheet dest)

Is This Answer Correct ?    7 Yes 4 No

I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel ..

Answer / kishore

U can use the below code to load the Excel to QTP
Dim App 'As Application
Set App = CreateObject("QuickTest.Application")
App.Test.Settings.Resources.DataTablePath ="datatablepath"

Is This Answer Correct ?    5 Yes 3 No

I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel ..

Answer / srini

code reads the 4 rows in the sheet ok, but does it 5 times?
It doesn't sound like closing the datasheet is the problem

how to close the datasheet runtime ?

Is This Answer Correct ?    3 Yes 1 No

I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel ..

Answer / sridatta

Dim i,row
row=datatable.getsheet("YOURSHEET").GetRowCount
for i=1 to row
datatable.getsheet("YOURSHEET").SetCurrentRow(i)
<---Do your Operation-->
This code will word

Is This Answer Correct ?    2 Yes 0 No

I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel ..

Answer / chivukula.kumar

datatable.Import("E:\Programming Samples\QTP
Samples\OrderNumbers.xls")

colcount = datatable.GetSheet(k).GetParametercount
rowcount = datatable.GetSheet(K).GetParametercount
shtcount = datatable.Getsheetcount

for i = 1 to rowcount step 1
for j = 1 to colcount step 1
for k = 1 to shtcount step 1
datatable.setcurrentrow(i)
val =datatable.Getsheet(k).GetParameter(j).ValuebyRow(i)
next
next
next


Note : the above script for entire workbook values we can
get .
next

Is This Answer Correct ?    1 Yes 1 No

I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel ..

Answer / sridatta

DataTable.Addsheet("Destination")
DataTable.ImportSheet "c:\path.xls","source","destination"
row=datatable.getsheet("Destination).getrowcount
for i=1 to row
datatable.SetCurrentRow(i)
val=datatable.Value("path","Global")
msgbox(val)
Next

Is This Answer Correct ?    1 Yes 1 No

I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel ..

Answer / jay desai

When you are importing an excel sheet into QTP, the
datatable defaults to the first row. Below is an example
that will help you importing all the data into QTP.

Dim jj,Rows
Rows=DataTable.LocalSheet.GetRowCount
For jj=1 to Rows
DataTable.LocalSheet.SetCurrentRow(jj)
.......
<Perform your operation>
.......
Next

'I hope the above code will work.

Is This Answer Correct ?    7 Yes 9 No

Post New Answer

More QTP Interview Questions

How do u connect database through QTP tell me both Ms Access and SQL

2 Answers   Livetek,


what is the main use of reviews

2 Answers   Ordain Solutions,


What is the difference between "call to action" and "call an existing action"

9 Answers   Accenture, Yana Software,


Hi, i have a string like "INDIA". I need to display this string vertically in Msgbox?

3 Answers  


in Qtp,how to display user name and pwd (script)in data table(global sheet).

2 Answers  


It seems Interview questions from Ordain Solutions are almost BASIC LEVEL-Easy. I am asking one tough question..(I think.. May be easy for some people) In recorded script the - WebLink("cityinfo") In reality, the WebLink name is "generalinfo" How you can write function to click that changed web link. NOTE: This functin should work with any Dynamic text link. I will post the answer later.

8 Answers  


how can u put synchronization point in qtp,wat is exactly synchroniztion why we use it wat is benifit in qtp

13 Answers   College School Exams Tests, Mind Tree,


Explain the difference between check point and output value?

0 Answers  


the build is develeped in Java. is possible to write scripting in vb using QTP ?

3 Answers  


if my application shows 100 records and in my database having 200 records how i can validate using QTP tool?plz exp. in detail?

2 Answers   Wipro,


what are the metrics in general we use in testing.

6 Answers   TCS,


describe common problems of test automation?

3 Answers  


Categories