This method is not supported in web tests (including cross-platform web tests) that use XPath expressions and CSS selectors to locate web elements. This method can be only used in tests that locate web objects by using internal identification properties provided by TestComplete. |
Description
CheckRow
moves the mouse pointer to a row of the tree panel control and then checks or unchecks this row.
Declaration
TestObj.CheckRow(Row, State)
TestObj | A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section | |||
Row | [in] | Required | Variant | |
State | [in] | Optional | Boolean | Default value: True |
Result | None |
Applies To
The method is applied to the following object:
View Mode
To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.
Parameters
The method has the following parameters:
Row
Specifies the zero-based index of the desired data row. The first visible row has index 0, the second - 1, and so on. The index of the last row is wRowCount
- 1.
State
Specifies whether a row should be checked or unchecked.
Possible values:
Value | Description |
---|---|
cbChecked, True or 1 | The row will be checked. |
cbUnchecked, False or 0 | The row will be unchecked. |
Result Value
None.
Remarks
If the specified row does not exist, or if it cannot be checked, CheckRow
fails and posts an error message to the test log. If the state of the specified row is already the same as the one specified by the State parameter, CheckRow
does not change the state of the row and posts an informative message to the test log.
Example
The following code demonstrates how you can check tree panel rows:
JavaScript, JScript
function Main()
{
// Obtain the page and the TreePanel control
var page = Sys.Browser().Page("http://www.example.com");
var TreePanel = page.Panel("TreePanel");
// Check and uncheck some rows
TreePanel.CheckRow(1, true);
TreePanel.CheckRow("Root", false);
// Check and uncheck some child rows
TreePanel.wChildView(1).CheckRow(1, true);
TreePanel.wChildView("Item2").CheckRow("Item2_1", false);
}
Python
def Main():
# Obtain the page and the TreePanel control
page = Sys.Browser().Page("http://www.example.com")
TreePanel = page.Panel("TreePanel")
# Check and uncheck some rows
TreePanel.CheckRow(1, True)
TreePanel.CheckRow("Root", False)
# Check and uncheck some child rows
TreePanel.wChildView[1].CheckRow(1, True)
TreePanel.wChildView["Item2"].CheckRow("Item2_1", False)
VBScript
Sub Main
Dim page, TreePanel
' Obtain the page and the TreePanel control
Set page = Sys.Browser.Page("http://www.example.com")
Set TreePanel = page.Panel("TreePanel")
' Check and uncheck some rows
Call TreePanel.CheckRow(1, True)
Call TreePanel.CheckRow("Root", False)
' Check and uncheck some child rows
Call TreePanel.wChildView(1).CheckRow(1, True)
Call TreePanel.wChildView("Item2").CheckRow("Item2_1", False)
End Sub
DelphiScript
procedure Main;
var page, TreePanel : variant;
begin
// Obtain the page and the TreePanel control
page := Sys.Browser.Page('http://www.example.com');
TreePanel := page.Panel('TreePanel');
// Check and uncheck some rows
TreePanel.CheckRow(1, true);
TreePanel.CheckRow('Root', false);
// Check and uncheck some child rows
TreePanel.wChildView(1).CheckRow(1, true);
TreePanel.wChildView('Item2').CheckRow('Item2_1', false);
end;
C++Script, C#Script
function Main()
{
// Obtain the page and the TreePanel control
var page = Sys["Browser"]()["Page"]("http://www.example.com");
var TreePanel = page["Panel"]("TreePanel");
// Check and uncheck some rows
TreePanel["CheckRow"](1, true);
TreePanel["CheckRow"]("Root", false);
// Check and uncheck some child rows
TreePanel["wChildView"](1)["CheckRow"](1, true);
TreePanel["wChildView"]("Item2")["CheckRow"]("Item2_1", false);
}
See Also
Collapse Action (Specific to Ext JS Panel Controls)
Expand Action (Specific to Ext JS Panel Controls)
wExpanded Property (Specific to Ext JS Panel Controls)