New to Telerik UI for WinForms? Download free 30-day trial

UI Automation Support

With the Q3 2024 version of our controls, RadNavigationView supports UI Automation. The current implementation of UI Automation for RadNavigationView is similar to the MS WinForms TabControl implementation with some extended functionality. The main goal of this implementation is to ensure compliance with accessibility standards and to provide a common practice for automated testing.

This functionality is enabled by default. To disable it, you can set the EnableUIAutomation property to false.


this.radNavigationView1.EnableUIAutomation = false;

navigationview-ui-automation

Relevant Properties

The table below outlines the UI Automation properties most important for understanding and interacting with RadNavigationView control.

RadNavigationView

  • AutomationElementIdentifiers.AutomationIdProperty.Id
  • AutomationElementIdentifiers.IsKeyboardFocusableProperty.Id
  • AutomationElementIdentifiers.NameProperty.Id
  • AutomationElementIdentifiers.LabeledByProperty.Id
  • AutomationElementIdentifiers.ControlTypeProperty.Id => ControlType.Tab.Id
  • AutomationElementIdentifiers.LocalizedControlTypeProperty.Id => "tab"
  • AutomationElementIdentifiers.IsContentElementProperty.Id
  • AutomationElementIdentifiers.IsControlElementProperty.Id
  • AutomationElementIdentifiers.OrientationProperty.Id
  • AutomationElementIdentifiers.ClassNameProperty.Id
  • AutomationElementIdentifiers.IsEnabledProperty.Id
  • AutomationElementIdentifiers.HasKeyboardFocusProperty.Id
  • AutomationElementIdentifiers.IsSelectionPatternAvailableProperty.Id
  • AutomationElementIdentifiers.IsExpandCollapsePatternAvailableProperty.Id

Hamburger Button Element

  • AutomationElementIdentifiers.NameProperty.Id
  • AutomationElementIdentifiers.AutomationIdProperty.Id => "Hamburger_Button"
  • AutomationElementIdentifiers.LocalizedControlTypeProperty.Id => "button"
  • AutomationElementIdentifiers.ControlTypeProperty.Id => ControlType.Button.Id
  • AutomationElementIdentifiers.IsControlElementProperty.Id
  • AutomationElementIdentifiers.IsContentElementProperty.Id
  • AutomationElementIdentifiers.ClassNameProperty.Id
  • AutomationElementIdentifiers.HelpTextProperty.Id
  • AutomationElementIdentifiers.IsInvokePatternAvailableProperty.Id
  • AutomationElementIdentifiers.ClickablePointProperty.Id
  • AutomationElementIdentifiers.IsEnabledProperty.Id

Navigation View Items

  • AutomationElementIdentifiers.AutomationIdProperty.Id => this.owner.Page.Name + "_item"
  • AutomationElementIdentifiers.NameProperty.Id
  • AutomationElementIdentifiers.ClickablePointProperty.Id
  • AutomationElementIdentifiers.LabeledByProperty.Id
  • AutomationElementIdentifiers.ControlTypeProperty.Id => ControlType.TabItem.Id
  • AutomationElementIdentifiers.LocalizedControlTypeProperty.Id => "tab item"
  • AutomationElementIdentifiers.IsControlElementProperty.Id
  • AutomationElementIdentifiers.IsContentElementProperty.Id
  • AutomationElementIdentifiers.IsKeyboardFocusableProperty.Id
  • AutomationElementIdentifiers.ClassNameProperty.Id
  • AutomationElementIdentifiers.IsEnabledProperty.Id
  • AutomationElementIdentifiers.HasKeyboardFocusProperty.Id
  • AutomationElementIdentifiers.IsSelectionItemPatternAvailableProperty.Id

Supported Control Patterns

The following section outlines the supported automation patterns for the RadNavigationView control and its constituent elements.

RadNavigationView

Hamburger Button Element

Navigation View Items

Custom Automation Provider

The RadNavigationView control expose CreateUIAutomationProvider() method that can be overriden to replace the default RadNavigationViewUIAutomationProvider class with your own implementation of the IRawElementProviderFragmentRoot interface.


public class MyRadNavigationView : RadNavigationView
{
    protected override System.Windows.Automation.Provider.IRawElementProviderFragmentRoot CreateUIAutomationProvider()
    {
        return new MyUIAutomationProvider();
    }

    public override string ThemeClassName
    {
        get
        {
            return typeof(RadNavigationView).FullName;
        }
    }
}

public class MyUIAutomationProvider : IRawElementProviderFragmentRoot
{
    public System.Windows.Rect BoundingRectangle => throw new NotImplementedException();

    public IRawElementProviderFragmentRoot FragmentRoot => throw new NotImplementedException();

    public ProviderOptions ProviderOptions => throw new NotImplementedException();

    public IRawElementProviderSimple HostRawElementProvider => throw new NotImplementedException();

    public IRawElementProviderFragment ElementProviderFromPoint(double x, double y)
    {
        throw new NotImplementedException();
    }

    public IRawElementProviderSimple[] GetEmbeddedFragmentRoots()
    {
        throw new NotImplementedException();
    }

    public IRawElementProviderFragment GetFocus()
    {
        throw new NotImplementedException();
    }

    public object GetPatternProvider(int patternId)
    {
        throw new NotImplementedException();
    }

    public object GetPropertyValue(int propertyId)
    {
        throw new NotImplementedException();
    }

    public int[] GetRuntimeId()
    {
        throw new NotImplementedException();
    }

    public IRawElementProviderFragment Navigate(NavigateDirection direction)
    {
        throw new NotImplementedException();
    }

    public void SetFocus()
    {
        throw new NotImplementedException();
    }
}