Forum Discussion

komalak11's avatar
komalak11
Contributor
6 years ago

Cannot click on object using a property other than full name

Hi,

 

I work on a desktop application developed on .NET, the objects are clicked identifying the full name property. I want to change this WPF property and try to identify the object through WPFAutomationID which is a customized property for my application. The problem with this property is no operation like click,set,enter can be performed using it. Can you please let me know how this can be used.

 

Full name : Sys["Process"]("NEOinsights")["WPFObject"]("HwndSource: ApplicationWindow", "ZEISS NEO insights - New project ")["WPFObject"]("ApplicationWindow", "ZEISS NEO insights - New project ", 1)["WPFObject"]("Grid", "", 1)["WPFObject"]("_Progress")["WPFObject"]("DockPanel", "", 1)["WPFObject"]("Grid", "", 1)["WPFObject"]("Grid", "", 1)["WPFObject"]("ContentControl", "", 1)["WPFObject"]("_DefaultLayoutView")["WPFObject"]("DockPanel", "", 1)["WPFObject"]("LayoutGrid")["WPFObject"]("ToolBar", "", 1)["WPFObject"]("StackPanel", "", 1)["WPFObject"]("_InnerPanel")["WPFObject"]("ListBoxItem", "", 1)["WPFObject"]("ToolBarCategoryView", "", 1)["WPFObject"]("DockPanel", "", 1)["WPFObject"]("UIButtonBar", "", 1)["WPFObject"]("ContentPresenter", "", 1)["WPFObject"]("ToolBarGroupView")["WPFObject"]("Grid", "", 1)["WPFObject"]("AutomationContentControl", "", 1)["WPFObject"]("ToggleButtonView", "", 1)["WPFObject"]("Grid", "", 1)["WPFObject"]("_TButton") ----- This works

 

With automationID

 

Sys["Process"]("NEOinsights")["WPFObject"]("HwndSource: ApplicationWindow", "ZEISS NEO insights - New project ")["WPFObject"]("ApplicationWindow", "ZEISS NEO insights - New project ", 1)["WPFObject"]("Grid", "", 1)["WPFObject"]("_Progress")["WPFObject"]("DockPanel", "", 1)["WPFObject"]("Grid", "", 1)["WPFObject"]("Grid", "", 1)["WPFObject"]("ContentControl", "", 1)["WPFObject"]("_DefaultLayoutView")["WPFObject"]("DockPanel", "", 1)["WPFObject"]("LayoutGrid")["WPFObject"]("ToolBar", "", 1)["WPFObject"]("StackPanel", "", 1)["WPFObject"]("_InnerPanel")["WPFObject"]("ListBoxItem", "", 1)["WPFObject"]("ToolBarCategoryView", "", 1)["WPFObject"]("DockPanel", "", 1)["WPFObject"]("UIButtonBar", "", 1)["WPFObject"]("ContentPresenter", "", 1)["WPFObject"]("ToolBarGroupView")["WPFObject"]("Grid", "", 1)["WPFObject"]("AutomationContentControl", "", 1)["WPFObject"]("ToggleButtonView", "", 1)["WPFObject"]("Grid", "", 1)["WPFObject"]("_TButton")["WPFControlAutomationId"]("ToolBar ToggleButton") ---- This doesnt work

1 Reply

  • sriram1's avatar
    sriram1
    Occasional Contributor

    Hi,

    Just make a note of the following tips

    1. After spying the object, always try to map the object. So it will simplifies the object name in terms of Aliases.Object name (varies for different objects)

    2. Now Using that mapped name perform the desired actions you need. 

    3. In case of any customised controls, just add the class name of the object in Default Project properties or Current project properties. 

    4. Also you can enable the  "*" symbol in each and every control types. You can refer the whole clarification in https://support.smartbear.com/testcomplete/docs/general-info/supported-technologies/controls/index.html. This thing makes the TC to work with all type of controls, ..customised too. 

    5. The only thing is ,if we need to perform the Automation in TC, we need to map the object as Mandatory. 

     

    Thanks 

    Regards, 

    Sriram