Forum Discussion
dermotcanniffe
SmartBear Alumni (Retired)
You might find using object mapping to be a better approach - you can map a custom object as the type of object you want to interact with.
Additionally, the object tree you're inspecting in TestComplete is a UI Automation -based object tree, while the object tree in the TestLeft Object Spy pictured above is pure WinForms. You may get results more akin to what you're looking for if you use the UIAPattern search pattern, e.g.
IWindow dxGridControl = driver.Find < IProcess > (new ProcessPattern() {
ProcessName = "WT-ToolExport"}).Find < ITopLevelWindow > (new UIAPattern() {
ObjectIdentifier = "DXSearchForm"}).Find < IWindow > (new UIAPattern() {
ObjectIdentifier = "datagridBottomLayoutControl"}).Find < IWindow > (new UIAPattern() {
ObjectIdentifier = "datagridPanelControl"}).Find < IWindow > (new UIAPattern() {
ObjectIdentifier = "gridControl"});
...or similar.
AndreyP
2 years agoNew Contributor
Hi dermotcanniffe,
Thank you for the answer, but I found a more correct way to solve my problem:
var Driver = new LocalDriver();
var className = "DXSearch.DxGridView.DxGridControl";
// Get the Developer Express Controls Controls category
var DExpressControls = Driver.Options.ObjectMapping["Developer Express Controls"];
// Get the WinForms category
var winFormsControls = DExpressControls["WinForms"];
// Get the list of classes mapped to the XtraGrid control
var XtraGrid = winFormsControls["XtraGrid"];
// Map a custom class to the XtraGrid control
XtraGrid.AddClassName(className);
Related Content
- 4 years ago
- 5 years ago
- 5 years ago
Recent Discussions
- 27 days ago
How to compare images?
Solved2 years ago- 5 months ago
- 10 months ago