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
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 |
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 |
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 |
Answer / ramu
by using the method of
dataTable.importsheet(filename,sheetsource,sheet dest)
Is This Answer Correct ? | 7 Yes | 4 No |
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 |
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 |
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 |
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 |
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 |
How to perform action on objects, If two objects have the almost the same name ? example : Object 1 : "Entry of Items" Object 2 : "Items" Whenever I ask QTP to perform an action on Object 2 it performs action on Object 1. Note: The two objects are present in an Oracle Application tree.
Hi, is it possible for recording shortcut key during record session? The application on which I am working is web based application. This application has several shortcut key associated with menu option. I have succesfully recorded all menu option but unable to record shortcut key.
hi, i am trying to capture "web element" names in a web page, and i written the code like this,, with Browser("title:=") with .page("") .webelement("htmltag:=...").getroproperty("innertext") end with end with //////////////////////////////////////////////////////////////////////////////////// QTP RETURN ERROR like this: " object's description matches more than one of the objects currently displayed in your application. Add additional properties to the object description in order to uniquely identify the object" ok fine , i need to search another property other than "index" i use all the properties like class,text,innerhtml,innertext,visible=true,x , y,abs x ,abs y...but qtp returns error ..... in this webpage index is difficult to find? how to solve
If there r 1000 test scripts that were written. If a change to any functionality is to be made then how can we know in which script is this functionality existing.
I have written some script in QTP and i added those objects in Object Repository. All written script has been executed successfully. After few days when i tried to execute the same script i got error message "objects not found in Object Repositiry". How can we solve this issue?
I am using DataTable.ImportSheet method to import the data from an excel sheet to the Runtime DataTable of QTP. here is my piece of code DataTable.import("c:\DataSheet.xls","Members","Members") The first row headings of Members sheet of DataSheet.xls and Members sheet of QTp are matched. but the QTP is taking very long time(approximately half an hour) to import the data into runtime datatable even though the DataSheet.xls has one or two rows in it. Please let me know why this is happening and is there any alternative for impoting the data into runtime datatable of qtp ?
how can i pass a "cript"as a parameter in to a function
Explain the check points in QTP?
What is a Web Table?
Explain the concept of how QTP identifies object.
If enter into interviewer room? how u introduce with him. with shakehand or waht?
How many types of run modes are there in qtp?