Ticket Q483407
Visible to All Users

DevExpress.Xpf.Grid.v11.2 or Higher Support UI Automation using CodedUI or HP-QTP

created 12 years ago

We are interested in UI testing applications with WPF controls, such as DXGrid for WPF. What is the prefered UI automation tool recommanded and supported by DevExpress i.e. CodedUI or HP-QTP.

Do we need any add-ons to enable recongizing controls for CodedUI/HP-QTP.
Can you provide some sample for the same.
We are using DevExpress.Xpf.Grid.v11.2 and ready to upgrade if supported for Automation.

Answers approved by DevExpress Support

created 12 years ago (modified 11 years ago)

Hello Bhupendra,
We do not provide support for specific testing tools in our WPF components (and cannot name a preferred one). However, we do provide support for the UI Automation framework. Therefore, any tool that uses this framework should work fine with our controls. Moreover, I know that some testing tool providers ensure a specific support for DevExpress components (for example, see TestComplete from SmartBear).
We are constantly working on improving our components, and starting with version 11.2 we've introduced a lot of improvements to UI Automation support. You will be able to test our controls via the UI Automation framework in version 11.2. However, if it is possible, I suggest that you upgrade to our current version to have better testing experience.
If you have additional questions, let me know.

    Show previous comments (7)
    Andrey Marten (DevExpress Support) 7 years ago

      Hello,

      At the moment, we support the standard UI Automation Framework to make our controls compatible with screen readers and support Section 508. While the current implementation may indeed be sufficient for some tests (as Alex' project illustrates), testing via UI Automation is not officially supported.

      If the current support for the UI Automation Framework is not sufficient for your tests, you will need to extend corresponding logic. See, for example, how it was done for AutoFitlerRow and NewItemRow of our GridControl in the following thread: T327788 - How to create a UI Automation test with NewItemRow and FilterItemRow.

      Should you have any difficulties with this, please let us know. We will be happy to assist you.

      Thanks,
      Andrey

        ok. I was able to get this to work:

        AutomationElement grid = AutomationElement.RootElement.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, "gridCtrlLegs"));

        where the XAML was set like this:

        <dxg:GridControl Margin="0"  MinHeight="100"  HorizontalAlignment="Center" Name="gridCtrlLegs" ItemsSource="{Binding TradeEntryLegs}" VerticalAlignment="Center" CurrentItem="{Binding FocusedTradeEntryLeg, Mode=OneWayToSource}" >

        But how do I do the same for this:

        AutomationElement grid = AutomationElement.RootElement.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, "Columns"));

        </dxb:BarEditItem>
        <dxb:BarEditItem Content ="  Columns x"Name = "Columns"  EditWidth="300"
        EditValue="{Binding SelectedOMDColumns,Mode=TwoWay, UpadteSourceTrigger=PropertyChanged,
        Converter={localTemplate:TypeListToIListConverter ItemType=localTempalte:ColumsnItem}}" >

        it does NOT work. So my question is how do i get the automation element for WPF Controls -> DevExpress.Xpf.Bars -> BarItem. It could not find it by its name- so would i have to code my own automation peer patter from scratch for this?

        Thank you

        Andrey Marten (DevExpress Support) 7 years ago

          Hello,

          I've created a separate ticket on your behalf (T598059: How to set AutomationId in a certain BarItem). It has been placed in our processing queue and will be answered shortly.

          Thanks,
          Andrey

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.