QTP Script to get DataTable ColumnCount,Adding new Column to Datatable,Getting Datatable Column Names

QTP Script to get datatable column count

Syntax:-DataTable.GetSheet("sheet name"/sheetid).getparametercount

Example:-DataTable.GetSheet(1).getparametercount

Script to add new parameter(column)to datatable

Syntax:-DataTable.GetSheet("sheet name"/sheetid).AddParameter "columnname","value"

Example:-DataTable.GetSheet(1).AddParameter "AAA","4"

QTP Script to get all parameter(column)names

For i=1 to a
b=DataTable.GetSheet(1).GetParameter(i).Name
msgbox (b)
Next

where a=parametercount(columncount)

To get rowcount of datatable

DataTable.GetRowCount

Datatable Methods

3 comments:

Anonymous said...

How do you get a row count for a specific column?

Steve

F n K said...

Steve check this link

http://funandknowledge.blogspot.com/2008/05/sc.html

Unknown said...

Hi, do you know if it is possible to change the name of a parameter (column) of the run-time data table loaded by qtp ?

Related Posts Plugin for WordPress, Blogger...

Fun and Knowledge