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...


Wher to use DATA TABLE METHODS in Qtp?What is the use of it?

Answers were Sorted based on User's Feedback



Wher to use DATA TABLE METHODS in Qtp?What is the use of it?..

Answer / nani

Hi,
Generally data table methods can use in run time.
wn ever we need data in run time then we can use data table
methods.
All methods performed on this object apply to the run-time
DataTable object only. Changes to the run-time DataTable
object are reflected in the test results, but the design-
time Data Table is not affected.
different data table methods are:
AddSheet Method
DeleteSheet Method
Export Method
ExportSheet Method
GetCurrentRow Method
GetRowCount Method
GetSheet Method
GetSheetCount Method
Import Method
SetCurrentRow Method
SetNextRow Method

Is This Answer Correct ?    25 Yes 1 No

Wher to use DATA TABLE METHODS in Qtp?What is the use of it?..

Answer / kalyan

Nani you are right. If u explain these methods with
examples it wil very use ful 4 beginenrs.

Thanks & Regards,
Kalyan

Is This Answer Correct ?    7 Yes 0 No

Wher to use DATA TABLE METHODS in Qtp?What is the use of it?..

Answer / sailaja

Just add-in of Nani Ans..Upto my knwz we can use functions
lik this

''To import xlsheet from desktop to datatable
datatable.Import("C:\Documents and
Settings\Raju\Desktop\seshu1.xls")
'
''From datatable to where we went to export tht we can
specify
datatable.Export("C:\Documents and
Settings\Raju\Desktop\test1.xls")
''
''If we wnt to add the sheet in datatable
a=DataTable.AddSheet ("Test").AddParameter("QTP", "Welcome
QTP")
msgbox a
'
''here 1 indicates "global sheet" & 2 indicates "action 1"
datatable.ExportSheet"C:\Documents and
Settings\Raju\Desktop\test2.xls", 2

'add the sheet in datatable &want to delete particular sheet
b=DataTable.AddSheet ("Test5").AddParameter("QTP", "Welcome
QTP")
msgbox b
datatable.DeleteSheet "Test5"

'add the sheet in data table & enter the xlsheet data into
the sheet
c=DataTable.AddSheet ("Test3").AddParameter("QTP", "Welcome
Test")
msgbox c
DataTable.ImportSheet"C:\Documents and
Settings\Raju\Desktop\test.xls", 1, 3

'add the sheet in data table & get the that sheet
d=DataTable.AddSheet ("Test3").AddParameter("QTP", "Welcome
Test")
msgbox d
DataTable.GetSheet ("Test3").AddParameter "Name", "Sailaja"

'add the sheets & count the no of sheets by including
global & action1 sheets also.
e=DataTable.AddSheet ("Test4").AddParameter("QTP", "Welcome
raju")
msgbox e
f=DataTable.AddSheet ("Test3").AddParameter("QTP", "Welcome
Test")
msgbox f
g= DataTable.GetSheetCount
msgbox g

'import the sheet into the datatable & identify the row
c=DataTable.AddSheet ("Test3").AddParameter("QTP", "Welcome
Test")
msgbox c
DataTable.ImportSheet"C:\Documents and
Settings\Raju\Desktop\test.xls", 1, 3
row = DataTable.GetCurrentRow
msgbox row
'
'add the sheet, get the no of rows in tht sheet
c=DataTable.AddSheet ("Test3").AddParameter("QTP", "Welcome
Test")
msgbox c
rowcount = DataTable.GetSheet("Test3").GetRowCount
msgbox rowcount
c1=DataTable.AddSheet ("Test3").AddParameter
("QTP1", "welcome test 1")
msgbox c1
rowcount1 = DataTable.GetSheet("Test3").GetrowCount
msgbox rowcount1



'How to import xlsheet in datatable & count in data table,
how to read line by line


Dim a,n,m,i
datatable.Import("C:\Documents and
Settings\Sailaja\Desktop\sailu.xls")
n=datatable.GetRowCount
msgbox n
For i=1 to n
datatable.SetCurrentRow(i)
m=datatable.Value("sailu", 1)
msgbox m
datatable.SetNextRow
Next




'How to get open xlsheet, count sheets& how to read data
line by line

Dim excel,workbook,DriverSheet,n,rowcount,fieldvalue,i,j
set excel=createobject("excel.application")
excel.visible=true

set workbook= excel.workbooks.open("C:\Documents and
Settings\Sailaja\Desktop\sailu.xls")
Set DriverSheet = Workbook.Worksheets("Sheet1")
n = DriverSheet.usedrange.columns.count
rowcount = DriverSheet.usedrange.rows.count
msgbox n
msgbox rowcount
For i = 1 to n
columnname = Driversheet.cells(i,1)
If columnname=columnname Then
For j = 1 to rowcount
fieldvalue = DriverSheet.cells(j,i)
msgbox fieldvalue
next
end if
next

Dim v,n
datatable.Import("C:\Documents and
Settings\Raju\Desktop\seshu1.xls")
n=datatable.GetRowCount
msgbox n
For i=1 to n
datatable.SetCurrentRow(i)
a=DataTable.Value(i)
msgbox a
j=datatable.SetNextRow
msgbox j
next

Is This Answer Correct ?    7 Yes 3 No

Wher to use DATA TABLE METHODS in Qtp?What is the use of it?..

Answer / mohammad

data table methods works with excell sheet only

Is This Answer Correct ?    6 Yes 6 No

Wher to use DATA TABLE METHODS in Qtp?What is the use of it?..

Answer / yogesh basediya

DataTable("A",1)=77
or
DataTable("A",Global)=99

For Local
DataTable("A",2)=77
or
DataTable("A","Action1")=99

Is This Answer Correct ?    1 Yes 2 No

Wher to use DATA TABLE METHODS in Qtp?What is the use of it?..

Answer / vasu

Hi Gautham, yes the "general error" will come when u use
Excel 2007. dont use it. use the excel versions of Excel 97
to 2003 versions. Then the path will work fine.

vasuseven@gmail.com (IBM)

Is This Answer Correct ?    0 Yes 1 No

Wher to use DATA TABLE METHODS in Qtp?What is the use of it?..

Answer / k.chandra sekhar

a) In QTP data table window is used to store the test
data, and parameterization that data to the test during
execution.
b) While go for out put values and data driven test
then use the data table window
c) The data table window mainly has the two types of
windows. They are
d) Global data table window
e) Action data table window
f) The global data table window is used for public
purpose, it default data table
g) Action data table window is used for local purpose,
it private purpose



My name is k.chandra sekhar,
My phone no is 09246540049,
Hyderabad.
My mail id is ndra_143@yahoo.co.in
If any body want full explain send the mail

Is This Answer Correct ?    5 Yes 7 No

Wher to use DATA TABLE METHODS in Qtp?What is the use of it?..

Answer / gautham

When I tried this, I am getting an error:


A general error occurred while importing file F:\world.xls.

Line (1): "DataTable.Import ("F:\world.xls")".



Why is it coming? Path is corretc.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More QTP Interview Questions

in a web page How to check and display a particular word from a paragraph?

0 Answers  


IF there are seven browsers with same name open. I want to close one particular browser thru QTP. how can i do this?

3 Answers   Polaris,


Can any body please tell me the steps of keyword driven frame work in qtp. My mail is saswat445@gmail.com please send some materials on keyword driven testing in qtp. thanks a lot...

0 Answers  


Hi all, i have installed QTP8.2 in my system. but script is not generating while recording. What is the problem? is any file missing? pls let me know anybody...Thnaks

3 Answers  


Synchronozation types in QTP

11 Answers   Diebold,


How we can call the scripit from another scripit in QTP?,Not a call Action

12 Answers  


what do you call the window testdirector-testlab?

1 Answers  


Synchronization methods?

8 Answers   Ordain Solutions,


Which line will be executed 1-B(DP).P(OR.link(DP) 2-B(OR).P(Or).Link(DP)

2 Answers   Broadridge,


What the differences are and best practical application of Object Repository?

0 Answers  


tell me types of environment variables? what r they? explain details? pls give anwer any one?

2 Answers   IBM,


what is the framework followed by ur company in qtp

5 Answers  


Categories