Is it possible to get the AutomationProperties.ItemStatus from a WPF application

2 posts, 0 answers
  1. Max
    Max avatar
    17 posts
    Member since:
    May 2012

    Posted 30 Sep 2015 Link to this post

    I am trying to get the AutomationProperties.ItemStatus using the Telerik Test framework and it does not seem to exist anywhere. Is the only way around it to do the following? Surely there is a way directly from Telerik framework?

    Get the handle from the Telerik framework and then use the System.Windows.Automation framework as follows...

    var wpfHandle = customTelerikFrameworkElement.wpfWindow.Window.Handle

    System.Windows.Automation.AutomationElement.FromHandle(this.wpfWindow.Window.Handle);                 

    var root = System.Windows.AutomationAutomationElement.RootElement;                 

    var image = root.FindFirst(TreeScope.Descendants, new System.Windows.Automation.PropertyCondition(System.Windows.Automation.AutomationElement.AutomationIdProperty, indicatorImage.AutomationId));

    var props = image.GetSupportedProperties();                 

    var prop = props.FirstOrDefault(p => p.ProgrammaticName == "AutomationElementIdentifiers.ItemStatusProperty");

    var statusPropertyValue = image.GetCurrentPropertyValue(prop);

  2. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 05 Oct 2015 Link to this post

    Hello Max,

    I don't think you can get  the AutomationProperties.ItemStatus using the Testing framework.

    Thank you for your understanding.

    Regards,
    Ivaylo
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top