- QTP - Home
- QTP - Introduction
- QTP - Test Automation
- QTP - Environment Setup
- QTP - Record and Play Back
- QTP - Object Repository
- QTP - Actions
- QTP - DataTables
- QTP - Checkpoints
- QTP - Synchronization
- QTP - Smart Identification
- QTP - Debugging
- QTP - Error Handling
- QTP - Recovery Scenarios
- QTP - Environment Variables
- QTP - Library Files
- QTP - Test Results
- QTP - GUI Objects
- QTP - Virtual Objects
- QTP - Accessing Databases
- QTP - Working with XML
- QTP - Descriptive Programming
- QTP - Automation Object Model
- QTP - Frameworks
- QTP - Designing a Framework
QTP - DTSheet Methods
| Method Name | Description | Syntax |
|---|---|---|
| AddParameter | Adds the specified column to the sheet in the run-time data table. | DTSheet.AddParameter (ParameterName, Value) |
| DeleteParameter | Deletes the specified parameter from the run-time data table. | DTSheet.DeleteParameter (ParameterID) |
| GetCurrentRow | Returns the row number of the active row in the run-time Data Table. | DTSheet.GetCurrentRow |
| GetParameter | Returns the specified parameter from the run-time Data Table. | DTSheet.GetParameter (ParameterID) |
| GetParameterCount | Returns the total number of Columns in the run-time Data Table. | DTSheet.GetParameterCount |
| GetRowCount | Returns the total number of rows in the run-time Data Table. | DTSheet.GetRowCount |
| SetCurrentRow | Sets the Focus on the specified Row of the Data Table | DTSheet.SetCurrentRow (RowNumber) |
| SetNextRow | Shifts the Focus to the next Row of the Data Table. | DTSheet.SetNextRow |
| SetPrevRow | Shifts the Focus to the Previous Row of the Data Table. | DTSheet.SetPrevRow |
Example
'Accessing Datatable to get Row Count and Column Count
rowcount = DataTable.GetSheet("Global").GetRowCount
msgbox rowcount ' Displays 4
colcount = DataTable.GetSheet("Global").GetParameterCount
msgbox colcount ' Displays 3
DataTable.SetCurrentRow(2)
val_rate = DataTable.Value("Rate","Global")
print val_rate ' Displays 7%
val_ppl = DataTable.Value("Principal","Global")
print val_ppl ' Displays 2556
val_Time = DataTable.Value("Time","Global")
print val_Time ' Displays 5
qtp_datatables.htm
Advertisements