TestComplete provides support for the most popular grid controls, including Microsoft DataGridView, Developer Express XtraGrid, Infragistics UltraGrid and others (for a full list, see Working With Grids - Basic Concepts). Supported grid controls are automatically associated with specific program objects that extend the grid control’s functionality with a number of supplementary methods and properties. These extended methods and properties let you perform various operations over grid controls, for example, simulate mouse clicks on grid cells, get and set cell values, and so on.
As for any other grid controls, the way you can work with them depends on whether the tested application is Open or non-Open:
-
For non-Open Applications, you can simulate mouse clicks, double-clicks, keypresses and other actions in the grids, using the Click
,
DblClick
, Keys
and other methods like the Sys.Keys
method. You can also use low-level procedures to simulate mouse and keyboard events over the grid control. However, this kind of testing is too complex and it is difficult to support, so we will not consider it here.
-
If your tested application is Open, tests get access to the grid’s internal methods and properties. For instance, to get the value of a grid cell, your script code can use a particular method of the grid. For a list of supported Open applications, see About Open Applications.
The topics of this section describe the approaches that can be used to perform various operations over Windows grid controls and provide detailed information on working with popular Windows grid controls (examples are included). To learn how to work with Android grid view controls, see the Working With Android Grid View Controls section.
In This Section
Contains information about the support provided by TestComplete for grid controls.
Describes approaches that can be used to perform various operations over grid controls.
Explains how you can work with Borland TDBGrid controls.
Describes how to work with Developer Express QuantumGrid controls.
Describes how to work with Developer Express XtraGrid controls.
Describes how to work with Infragistics UltraGrid controls.
Describes how to work with Infragistics UltraWebGrid controls.
Describes how to work with Java Swing JTable controls.
Explains how to work with Microsoft DataGrid .NET controls.
Describes how to work with Microsoft DataGridView controls.
Explains how you can work with Microsoft PropertyGrid controls.
Describes how to work with the GridControl controls of the Syncfusion Essential Grid library.
Explains how you can work with the GridDataBoundGrid controls of the Syncfusion Essential Grid library.
Describes how you can work with the GridGroupingControl controls of the Syncfusion Essential Grid library.
Related Topics of Interest
Explains how to create checkpoints that verify data displayed in tabular controls.
Samples
TestComplete includes a number of sample projects that demonstrate how to work with various grid controls:
Borland TDBGrid:
<TestComplete Samples>\Desktop\Working With Grids\Borland TDBGrid
Borland StringGrid:
<TestComplete Samples>\Desktop\Working With Grids\Borland TStringGrid
Developer Express PropertyGrid:
<TestComplete Samples>\Desktop\Working With Grids\DevExpress PropertyGrid
Developer Express QuantumGrid:
<TestComplete Samples>\Desktop\Working With Grids\DevExpress QuantumGrid
Developer Express VerticalGrid:
<TestComplete Samples>\Desktop\Working With Grids\DevExpress VerticalGrid
Developer Express WPFGrid:
<TestComplete Samples>\Desktop\Working With Grids\DevExpress WPFGrid
Developer Express XtraGrid:
<TestComplete Samples>\Desktop\Working With Grids\DevExpress XtraGrid
Developer Express XtraVerticalGrid:
<TestComplete Samples>\Desktop\Working With Grids\DevExpress XtraVerticalGrid
Infragistics UltraGrid:
<TestComplete Samples>\Desktop\Working With Grids\Infragistics WinGrid
Infragistics XamDataGrid:
<TestComplete Samples>\Desktop\Working With Grids\Infragistics XamDataGrid
Swing JTable:
<TestComplete Samples>\Desktop\Working With Grids\JTable
Microsoft DataGridView:
<TestComplete Samples>\Desktop\Working With Grids\Microsoft DataGridView
Microsoft PropertyGrid:
<TestComplete Samples>\Desktop\Working With Grids\Microsoft PropertyGrid
QtTableWidget:
<TestComplete Samples>\Desktop\Working With Grids\QtTableWidget
Telerik RadGridView:
<TestComplete Samples>\Desktop\Working With Grids\Telerik RadGridView
TMS TAdvStringGrid:
<TestComplete Samples>\Desktop\Working With Grids\TMS TAdvStringGrid
Xceed GridControl:
<TestComplete Samples>\Desktop\Working With Grids\Xceed DotNetGrid
You can download more grid samples from http://support.smartbear.com/downloads/testcomplete/samples. The names of the sample scripts coincide with the names of the grid controls they test:
ComponentOne True DBGrid Pro
ComponentOne True DBGrid ProComponentOne True DBGrid ProThis script requires the sample application which is part of the Studio Enterprise trial download package that is available at http://www.componentone.com/Downloadcenter.aspx?PanelIndex=4. The script assumes that by default the application under test has the following path: <ComponentOne Studio>\True DBGrid Pro 8.0\Tutorials\OLEDB\Tutor20\Tutor20.exe. Before running the script, make sure that the TestComplete Tested Applications project item holds a valid link to the application to be tested (Tutor20.exe).
The script includes three custom routines that you can use in your scripts with minimum changes (if any). Each routine uses the direct access to grid cells.
-
The FindRowByCellValue
routine locates the grid’s row by the value held in the specified column.
-
The LogRowData
routine reads the contents of all the cells in the given row and posts it to the test log.
-
The LoadDataFromFile
routine adds a new row to the grid and populates it with values stored in a comma-separated values (CSV) file.
ComponentOne VSFlexGrid Pro
ComponentOne VSFlexGrid ProComponentOne VSFlexGrid ProThis script requires the sample application which is part of the Studio Enterprise trial download package that is available at http://www.componentone.com/Downloadcenter.aspx?PanelIndex=4. The script assumes that by default the application under test has the following path: <ComponentOne Studio>\VS FlexGridPro 8.0\Samples\Vb\CustDataSort\Project1.exe. Before running the script, make sure that the TestComplete Tested Applications project item contains a valid link to the application to be tested (Project1.exe).
The script includes three custom routines that you can use in your scripts with minimum changes (if any). Each routine uses the direct access to the grid cells.
-
The FindRowByCellValue
routine locates the grid’s row by the value held in the specified column.
-
The LogRowData
routine reads the contents of all the cells in the given row and posts it to the test log.
-
The LoadDataFromFile
routine adds a new row to the grid and populates it with values stored in a comma-separated values (CSV) file.
Janus GridEX
Janus GridEXJanus GridEXThis sample demonstrates how to work with Janus GridEX control v. 1 or 2 from scripts. The sample script requires a Janus GridEX 2000b ActiveX Control sample application available at http://www.janusys.com. The script assumes that by default the tested application has the following path: <Janus Systems Components>\Janus GridEX 2000\Samples\NorthWind\NorthWin.EXE. Before running the script, make sure that the TestComplete Tested Applications project item contains a valid link to the desired tested application (NorthWin.exe).
Before launching the script for the first time, it is necessary to run NorthWin.EXE and select the database for the grid which is located here: <Janus Systems Components>\Janus GridEX 2000\Samples\JSNWind.mdb.
The script includes several custom routines that you can use in your scripts with minimum changes (if any). These routines use the grid’s dataset.
-
The FindRowByCellValue
routine locates the grid’s row by the value held in the specified column.
-
The LogRowData
routine reads the contents of all cells in the given row and posts it to the test log.
-
The LoadDataFromFile
routine adds a new row to the grid and populates it with values stored in a comma-separated values (CSV) file.
-
The CloseAboutWin
routine is used to close the About window that is displayed when the tested application starts.
Janus GridEX v3
Janus GridEX v3Janus GridEX v3This sample demonstrates how you can work with Janus GridEX control ver. 3 from scripts. The sample script requires the sample application that is available at http://www.janusys.com. The script assumes that by default the tested application has the following path: <Janus Systems>\Controls for Microsoft .NET\Windows Forms Controls v3\Demos\Janus.NorthwindDemo.exe. Before running the script, make sure that the TestComplete Tested Applications project item contains a valid link to the desired tested application (Janus.NorthwindDemo.exe).
The script includes several custom routines that you can use in your scripts with minimum changes (if any). These routines use the grid’s dataset.
-
The FindRowByCellValue
routine locates the grid’s row by the value held in the specified
column.
-
The LogRowData
routine reads the contents of all cells in the given row and posts it to the test log.
-
The LoadDataFromFile
routine adds a new row to the grid and populates it with values stored in a comma-separated values (CSV) file.
-
The CloseReminderForm
routine is used to close the reminder window that is displayed when the tested application starts.
See Also
Object-Specific Tasks
Simulating User Actions
Supported Controls