DataTable Method
GetRowCount:
Description :
Returns the total number of
rows in the longest column in the first sheet in the run-time Data Table
(global sheet).
Syntax
Return Value : Number
Example :
The following example uses the GetRowCount
method to find the total number of rows in the longest column of the MySheet
run-time data sheet and writes it to the report.
-------------------------------------------------------------------------------------------------
SetNextRow:
Description:
Note: You can only set a row that
contains at least one value. If the current row is the last row in the Data
Table, applying this method sets the first row in the Data Table as the new
current row.
Syntax :
Example :
The following example uses the SetNextRow
method to change the active row to the next row in the run-time Data Table.
SetCurrentRow:
Description :
Syntax :`
Example
The following example uses the SetCurrentRow
method to change the active row to the second row in the global run-time Data
Table.
GetSheet:
Description :
Syntax :
Return Value : Number
Example :
The following example uses the GetSheetCount
method to find the total number of sheets in the run-time Data Table and writes
it to the report.
-------------------------------------------------------------------------------------------------
GetParameterCounts:
Description :
Syntax : DTSheet.GetParameterCount
http://akhilreddytechnologies.blogspot.in/2015/07/qtp-real-time-very-imp-scripts-for.html
Return Value :Number
Example
The following example uses the GetParameterCount
method to find the total number of parameters (columns) in the run-time Data
Table sheet (MySheet) and writes it to the report.
-------------------------------------------------------------------------------------------------
AddSheet:
Description :
Adds the specified sheet to the
run-time Data Table and returns the sheet so that you can directly set
properties of the new sheet in the same statement.
Syntax :
Return Value : DTSheet Object.
Example :
The following example uses the AddSheet
method to create the new sheet, "MySheet" in the run-time Data Table
and then adds a parameter to the new sheet.
-------------------------------------------------------------------------------------------------
DeleteSheet:
Description :
Syntax :
Example
The following example uses the DeleteSheet
method to delete the sheet, "MySheet" from the run-time Data Table.
-------------------------------------------------------------------------------------------------http://akhilreddytechnologies.blogspot.in/2015/07/qtp-real-time-very-imp-scripts-for.html
GetSheetCount:
Description : Returns the total number of sheets in the run-time Data Table.
Syntax : DataTable.GetSheetCount
Return Value : Number
Example
The following example uses the GetSheetCount
method to find the total number of sheets in the run-time Data Table and writes
it to the report.
sheetcount =
DataTable.GetSheetCount
Reporter.ReportEvent 0,
"Sheet number", "There are " & sheetcount & "
sheets in the Data Table."
AddParameter:
Description :
Adds the specified parameter
(column) to the sheet in the run-time Data Table, sets the value of the first
row to the specified value, and returns the parameter so that you can directly
set or retrieve properties of the new parameter in the same statement.
Syntax : DTSheet.AddParameter(ParameterName, Value)
Return Value :DTParameter Object
Examplehttp://akhilreddytechnologies.blogspot.in/2015/07/qtp-real-time-very-imp-scripts-for.html
The following example uses the AddParameter
method to create the new Parameter, "Arrival" within the new sheet,
MySheet of the run-time Data Table, and sets the first cell in the column as
"New York". Because the method also returns the newly created
parameter, it is possible to use methods or check properties of the new sheet
within the same statement.
Note
that if a parameter with the name "Arrival" already exists in the
sheet, the example above will return "Arrival1" as the actual name
assigned to the new parameter.
No comments:
Post a Comment