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.
3 Answers, 1 is accepted
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 the drop down of the ComboBox is clicked in order to open\expand it.
in the sample 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.
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.
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.
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.
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). 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.