Showing posts with label add parameter to datatable. Show all posts
Showing posts with label add parameter to datatable. Show all posts

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

Related Posts Plugin for WordPress, Blogger...

Fun and Knowledge