Forum Discussion
dermotcanniffe
2 years agoSmartBear 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.
- AndreyP2 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
- 3 years ago
- 11 months ago
Recent Discussions
- 3 months ago
- 7 months ago