Unable to perform Expand operation on RadComboBox.

4 posts, 0 answers
  1. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 21 Mar Link to this post

    Hi,

         We are trying to expand RadComboBox using CUIT and UIAutomation. Both are throwing exceptions. The exception name is ElementNotAvailableException. In CUIT the inner exception name is InvalidOperationException. Is there any way to perform expand operation on RadComboBox without getting exceptions?.Any help to solve this problem is greatly appreciated.

    Regards,

    Nagasree.

  2. Georgi
    Admin
    Georgi avatar
    349 posts

    Posted 21 Mar Link to this post

    Hi Nagasree,

    Please note, that we are not aware of such exception. I'm attaching to my reply a sample application and a Coded UI project where we have tested this scenario. In the Coded UI test recorded via the Coded UI recorder the drop down of the ComboBox is clicked in order to open\expand it.

    Also in the sample application you can find a button that expands ComboBox via the UIAutomation ExpandCollapse pattern. Furthermore, we have tested it with UISpy and UI Verify, but we were not able to reproduce the exception.

    So it would be great if you could check the attached project and let us know if we are not missing something. If that is the case it would be great if you could provide us with more information on the matter as sample project would be of great help.

    Also, can you confirm that you are using 2016.1 217 version of the controls and for Coded UI you have reference to the ExtensionsCore.dll assembly as shown in this help article.

    Hope this would help.

    Regards,
    Georgi
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 22 Mar in reply to Georgi Link to this post

    Hi,

        We are trying to expand RadComboBox using ExpandCollapsePattern. We are using UIAComWrapper for UIAutomation. The Expand() method is giving exception as ElementNotAvailableException. We also tried to expand RadComboBox using CodedUITest. In this CodedUITest we have used the statement comboBox.Expanded = True. We didnot clicked on the dropdown button. We are using VisualStudio 2013. We are not sure whether the UISpy and UI Verify uses the new dlls(UIAComWrapper) for UIAutomation.

     

     

  5. Georgi
    Admin
    Georgi avatar
    349 posts

    Posted 22 Mar Link to this post

    Hi Nagasree,

    Thanks to your additional information we were able to reproduce the exception and after further investigations, it seems to be Microsoft related issue. So the cause of it is that when any control pattern is invoked the UIAutomation internally calls GotFocus() to that element. Therefore, the ComboBox revises the focus and moves it to its TextBox part which seems to intervene with the UIAutomation and the exception is thrown.

    Furthermore it seems like Microsoft acknowledged that when the control pattern is executed the GotFocus() method should not be always called as they have introduced the AutoSetFocus property. Sadly this is supported for Windows 8 and higher OS and seems like the reason why we were not able to reproduce it on machines with OS version higher than Windows 7.
    Also attached you can find project showing how the issue can be reproduced with sample GroupBox and TextBox.

    Nevertheless it would be of help if you could confirm that at your end it can be reproduced on Windows7 and not on Windows8 (or higher). Also can you confirm that this happens only with editable ComboBox and cannot be reproduced with the non-editable one (as there is no TextBox to get the focus)?


    Hope this would shine some light on the matter.

    Regards,
    Georgi
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top