Sunday, March 8, 2009

QTP Writing to Datatable

Adding a value to Global Sheet

DataTable.GlobalSheet.AddParameter "A", 1




Adding a value to Local Sheet

DataTable.LocalSheet.AddParameter "A", 1




Adding a value to Global Sheet

DataTable.GetSheet(1).AddParameter "A", 1
or
DataTable.GetSheet("Global").AddParameter "A", 1




Adding a value to Local Sheet
DataTable.GetSheet(2).AddParameter "A", 1
or
DataTable.GetSheet("Action1").AddParameter "A", 1




Adding a value to Global Sheet

DataTable.Value("A", 1)=99
or
DataTable.Value("A", Global)=99




Adding a value to Local Sheet

DataTable.Value("A", 2)=99
or
DataTable.Value("A", "Action1")=99




Adding a value to Global Sheet

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




Adding a value to Local Sheet

DataTable("A", 2)=63
or
DataTable("A", "Action1")=63




Below statement always writes into the Global Sheet

DataTable("A")=100




Also See:


QTP Data Table Basics


Reading values From Data Table

How to import excel sheet into data table in QTP

Accessing Data Table through scripts

Multiple Choice Questions on Data Table

Table Checkpoints Multiple Choice Questions

Data Table Menu Shortcut Keys